GurobiError: No variable names available to index

Comments

4 comments

  • Eli Towle

    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
    Comment actions Permalink
  • Rohan Bhatia

    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,
    Rohan

    0
    Comment actions Permalink
  • Eli Towle

    Hi Rohan,

    Could you try calling Model.update() immediately before reading the .mst file? Thanks!

    Eli

    0
    Comment actions Permalink
  • Rohan Bhatia

    Hi Eli,

    It worked! Thanks!

    Rohan

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk