Skip to main content

Type error and Gurobi error

Ongoing

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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?.
  • Eli Towle
    • Gurobi Staff

    You unfortunately can't call Model.write() during the solution process. You would have to write your own solution file using Python's built-in file writing. In addition, it seems there is a problem with the way variables and their values are retrieved from Pyomo in the callback.

    Assuming you are using Gurobi 9.0 or later, the SolFiles parameter you mentioned is the easiest way to save intermediate solutions. It should work through the Pyomo interface. Can you try passing the full path name (e.g., \( \texttt{/home/ayo/Project_folder/mymodel15} \)) to the SolFiles parameter? The tilde \( \texttt{~} \) shortcut is resolved by your shell, so it won't necessarily work as expected when used outside a shell environment.

    0
  • Olayinka Ayo
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you so much Eli. SolFiles worked as you mentioned.

    0
  • Fabian Hofacker
    • Gurobi-versary
    • First Comment

    Hey, 

    I got a gurobipy.GurobiError as well but there is no specification of what exactly went wrong.

    That's the error:

    File "...", line 109, in <module>
    m.optimize(subtourelim)
    File "src\gurobipy\model.pxi", line 864, in gurobipy.Model.optimize
    gurobipy.GurobiError

    I haven't found any information on solving this.
    Can you help me?

    0

Post is closed for comments.