I follow the example in the document. However, it failed. Does ipopt support this way of passing options?
Sometimes it is desirable to pass options as part of the call to the solve function as in this snippet:
results = optimizer.solve(instance, options="threads=4", tee=True)
# example.py
from pyomo.environ import *
from pyomo.contrib.mindtpy.tests.eight_process_problem import EightProcessFlowsheet
model = EightProcessFlowsheet(convex=True)
opt = SolverFactory('ipopt')
result = opt.solve(model,tee=True,options="maxit=100")
Error Message
Traceback (most recent call last):
File "/Users/zedongpeng/Github/sofc_models-main/test.py", line 33, in <module>
result = opt.solve(model,tee=True,options="maxit=100")
File "/Users/zedongpeng/Github/pyomo/pyomo/opt/base/solvers.py", line 562, in solve
self.options.update(kwds.pop('options', {}))
File "/Users/zedongpeng/Github/pyomo/pyomo/common/collections/bunch.py", line 51, in update
if type(d[k]) is dict:
TypeError: string indices must be integers
Information on your system
Pyomo version: 6.4.3.dev0
Python version: 3.7.12
Operating system: MacOS Version 12.2
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable): ipopt
Summary
I follow the example in the document. However, it failed. Does
ipopt
support this way of passing options?https://pyomo.readthedocs.io/en/stable/working_models.html#sending-options-to-the-solver
Steps to reproduce the issue
Error Message
Information on your system
Pyomo version: 6.4.3.dev0 Python version: 3.7.12 Operating system: MacOS Version 12.2 How Pyomo was installed (PyPI, conda, source): source Solver (if applicable): ipopt
Additional information