【发布时间】:2019-06-16 12:31:40
【问题描述】:
我正在尝试让我的第一个 Pyomo 模型在我的 Ubuntu VM (Azure) 上运行。我在这台机器上安装了 Python3 和 COIN-OR 求解器。无论我尝试什么求解器,我都会得到相同的结果。
编辑:将求解器更改为 couenne(这是一个非线性问题),Jupyter 输出如下所示。当我打开 tmp 目录中的日志文件时,couenne.log 文件中没有任何内容,pyomo 文件是问题的表述。所以我假设 Pyomo 根本没有与 Couenne 求解器通信?
Solver log file: '/tmp/tmpezw0sov2_couenne.log'
Solver solution file: '/tmp/tmpq6afa7e8.pyomo.sol'
Solver problem files: ('/tmp/tmpq6afa7e8.pyomo.nl',)
ERROR: Solver (asl) returned non-zero return code (-1)
ERROR: See the solver log above for diagnostic information.
---------------------------------------------------------------------------
ApplicationError Traceback (most recent call last)
<ipython-input-6-486e3a9173f4> in <module>()
20 #instance = model.create_instance()
21 opt = SolverFactory('couenne', executable = solverpath_exe)
---> 22 opt.solve(model,tee=True,keepfiles=True)
23 #solver=SolverFactory(solvername,executable=solverpath_exe)
/home/ralphasher/.local/lib/python3.6/site-packages/pyomo/opt/base/solvers.py in solve(self, *args, **kwds)
598 logger.error("Solver log:\n" + str(_status.log))
599 raise pyutilib.common.ApplicationError(
--> 600 "Solver (%s) did not exit normally" % self.name)
601 solve_completion_time = time.time()
602 if self._report_timing:
ApplicationError: Solver (asl) did not exit normally
【问题讨论】:
-
keepfiles=True可能程序没有覆盖现有的日志文件,您可以尝试移动或删除空的日志文件吗? -
@steviestickman 好点! @Ralph 另外,Pyomo 是否能够与您的求解器通信?日志文件的内容应与您使用
tee=True获得的文本内容相同。您的终端中是否有某些内容显示 cbc 试图解决您的模型(使用tee=True)?如果是这样,cbc 当时在做什么? -
以上编辑,请查看
-
如果日志什么都没有,没有a means to reproduce the problem,我们就不能说什么。
标签: python ubuntu pyomo coin-or