Python read from MPS not working
回答済みI am trying to read an .mps file that is originally created by gurobi. I get the following error:
Can't import file 'debug_default.mps' into a model
I also tried to import the example .mps/.lp files that come with Gurobi installation but I get the same error. What could be the cause of this problem?
My code looks like this:
import gurobipy as gp
import os
os.chdir('.miniforge3/pkgs/gurobi-10.0.0-py310_0/share/doc/gurobi/examples/data')
model = gp.Model()
model.read('coins.mps')
0
-
You are trying to read the model file using the Model.read() method, which is used for reading data (like a MIP start or LP basis file) into an existing model. Instead, use gurobipy's read() function:
import gurobipy as gp
model = gp.read("/path/to/coins.mps")0
サインインしてコメントを残してください。
コメント
1件のコメント