Gurobi 12.0 with Pyomo
回答済みI got this error try to use gurobi 12.0 with pyomo
File /opt/anaconda3/envs/E2EGas/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/gurobi_direct.py:526, in GurobiDirect._add_constraint(self, con) 521 raise ValueError( 522 "Upper bound of constraint {0} is not constant.".format(con) 523 ) 525 if con.equality: --> 526 gurobipy_con = self._solver_model.addConstr( 527 lhs=gurobi_expr, 528 sense=gurobipy.GRB.EQUAL, 529 rhs=value(con.lower), 530 name=conname, 531 ) 532 elif con.has_lb() and con.has_ub(): 533 gurobipy_con = self._solver_model.addRange( 534 gurobi_expr, value(con.lower), value(con.upper), name=conname 535 ) File src/gurobipy/_model.pyx:3894, in gurobipy._model.Model.addConstr() TypeError: addConstr() got an unexpected keyword argument 'sense'
-
Please have a look at the detailed release notes for Gurobi version 12.0.
0 -
Hi Sompol,
Actually I believe the problem is not in your own code, but in Pyomo. It looks like this version of Pyomo calls a Gurobi function that has been removed in version 12. However, I don't see that specific code in the latest version of Pyomo. Are you using the latest version / could you try upgrading Pyomo?
Kind regards,
Ronald0
サインインしてコメントを残してください。
コメント
2件のコメント