docplex 2.10.15x 的类型错误
TypeError with docplex 2.10.15x
从 docplex 2.9.141 切换到版本 2.10.150(与 2.10.151 相同)后,当我尝试在我的模型上调用 solve
(使用我的 docloud 凭据)时,我开始遇到以下错误。
我预计此问题是由于 class ProgressData
已更改为 namedtuple subclass 并且不再具有默认属性值。
File ".../venv/lib/python3.7/site-packages/docplex/mp/model.py", line 4018, in solve
return self._solve_cloud(context, lex_mipstart)
File ".../venv/lib/python3.7/site-packages/docplex/mp/model.py", line 4227, in _solve_cloud
new_solution = docloud_engine.solve(self, parameters=parameters, lex_mipstart=lex_mipstart)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_engine.py", line 632, in solve
info_to_monitor={'jobid', 'progress'})
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 251, in submit_model_data
info_to_monitor=info_to_monitor)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 442, in wait_for_completion
loop.start(**kwargs)
File ".../venv/lib/python3.7/site-packages/docplex/mp/utils.py", line 688, in start
self.scheduler.run()
File "/opt/anaconda/lib/python3.7/sched.py", line 151, in run
action(*argument, **kwargs)
File ".../venv/lib/python3.7/site-packages/docplex/mp/utils.py", line 673, in <lambda>
lambda a: self._process_task(a), (task.id,))
File ".../venv/lib/python3.7/site-packages/docplex/mp/utils.py", line 678, in _process_task
task.action(*task.argument)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 373, in progress_poll
progress_data = self.map_job_info_to_progress_data(info)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 485, in map_job_info_to_progress_data
pg = ProgressData()
TypeError: __new__() missing 10 required positional arguments: 'id', 'has_incumbent', 'current_objective', 'best_bound', 'mip_gap', 'current_nb_iterations', 'current_nb_nodes', 'remaining_nb_nodes', 'time', and 'det_time'
这是新版本引入的错误还是我做错了什么?
这是一个错误 - 我会尽快部署修复程序
docplex 2.10.154 应该可以解决这个问题。你能更新并重试吗?对于给您带来的不便,我们深表歉意。
从 docplex 2.9.141 切换到版本 2.10.150(与 2.10.151 相同)后,当我尝试在我的模型上调用 solve
(使用我的 docloud 凭据)时,我开始遇到以下错误。
我预计此问题是由于 class ProgressData
已更改为 namedtuple subclass 并且不再具有默认属性值。
File ".../venv/lib/python3.7/site-packages/docplex/mp/model.py", line 4018, in solve
return self._solve_cloud(context, lex_mipstart)
File ".../venv/lib/python3.7/site-packages/docplex/mp/model.py", line 4227, in _solve_cloud
new_solution = docloud_engine.solve(self, parameters=parameters, lex_mipstart=lex_mipstart)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_engine.py", line 632, in solve
info_to_monitor={'jobid', 'progress'})
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 251, in submit_model_data
info_to_monitor=info_to_monitor)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 442, in wait_for_completion
loop.start(**kwargs)
File ".../venv/lib/python3.7/site-packages/docplex/mp/utils.py", line 688, in start
self.scheduler.run()
File "/opt/anaconda/lib/python3.7/sched.py", line 151, in run
action(*argument, **kwargs)
File ".../venv/lib/python3.7/site-packages/docplex/mp/utils.py", line 673, in <lambda>
lambda a: self._process_task(a), (task.id,))
File ".../venv/lib/python3.7/site-packages/docplex/mp/utils.py", line 678, in _process_task
task.action(*task.argument)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 373, in progress_poll
progress_data = self.map_job_info_to_progress_data(info)
File ".../venv/lib/python3.7/site-packages/docplex/mp/docloud_connector.py", line 485, in map_job_info_to_progress_data
pg = ProgressData()
TypeError: __new__() missing 10 required positional arguments: 'id', 'has_incumbent', 'current_objective', 'best_bound', 'mip_gap', 'current_nb_iterations', 'current_nb_nodes', 'remaining_nb_nodes', 'time', and 'det_time'
这是新版本引入的错误还是我做错了什么?
这是一个错误 - 我会尽快部署修复程序
docplex 2.10.154 应该可以解决这个问题。你能更新并重试吗?对于给您带来的不便,我们深表歉意。