我正在使用具有AMPL许可下的许可版本的Baron解算器来解决Pyomo和Spyder中的MINLP。 我在代码中使用男爵,如下所示:
opt=SolverFactory('baron', executable='/home/LocalUser/ampl_linux-intel64/baron')
result=opt.solve(instance, keepfiles=True,tee=True)
但是当我运行代码时,出现此错误:
Solver log file: '/tmp/tmpil8__em2.baron.log'
Solver solution file: '/tmp/tmpvphbmoa8.baron.soln'
Solver problem files: ('/tmp/tmpl7sk5uym.pyomo.bar',)
/home/LocalUser/ampl_linux-intel64/baron: can't open /tmp/tmpl7sk5uym.pyomo.bar.nl
ERROR: Solver (baron) returned non-zero return code (1)
ERROR: See the solver log above for diagnostic information.
Traceback (most recent call last):
File "Platform-nonlinear.py", line 236, in <module>
result=opt.solve(instance, keepfiles=True,tee=True)
File "/home/LocalUser/.local/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 596, in solve
"Solver (%s) did not exit normally" % self.name)
pyutilib.common._exceptions.ApplicationError: Solver (baron) did not exit normally
我在Windows和Linux上都尝试过,但是两次都遇到相同的错误!!! T真的不知道该如何解决!