我正在尝试让我的第一个 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