GurobiError: No variable names available to index
回答済みWhile trying to use model.read(path_to_mst_file) in gurobipy, I get the following error:
File "model.pxi", line 1537, in gurobipy.Model.read
GurobiError: No variable names available to index
How do I deal with this?
Thanks
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Rohan,
You could see this error if you are trying to read a solution file into a model with no variables. Did you add variables to the model (named to match the variables in the .mst file) prior to calling Model.read()?
Thanks,
Eli
0 -
Hi Eli! Thanks for the comment. Actually, the model contains all the variables when I'm calling model.read. I'm calling it just before model.optimize().
Could there be any other reasons for this error?
Thanks,
Rohan0 -
Hi Rohan,
Could you try calling Model.update() immediately before reading the .mst file? Thanks!
Eli
2 -
Hi Eli,
It worked! Thanks!
Rohan
1
投稿コメントは受け付けていません。
コメント
5件のコメント