Dead kernel
回答済みDear community,
I came across something rather annoying :) When I execute the optimization problem, the solver ends with an optimal solution. Then I extract the solution and try to print/ plot them. I use jupyter notebook for all these tasks. The problem is when I try to execute a plot (using matplotlib) the kernel crashes. Probably this is not a Gurobi question, but I wanted to ask if anyone has experienced this before and if so what kind of solution can anyone propose to me.
Gurobi - 9.0.1
Python - 3.7
Thank you,
Buddi
-
正式なコメント
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 Buddi,
Could you please share some more details on this issue? It would be best if you could provide us with a (minimal) reproducible example that we can run ourselves.
At the moment, I suppose that there is some issue with your matplotlib module. Did you already try updating matplotlib?
Thanks,
Matthias0 -
Hi Matthias,
Thank you very much. I tried to run the same problem with a reduced number of constraints and then this issue does not appear. I tried creating a new environment, reinstalling anaconda, jupyter, etc. But only way I could avoid the problem was by reducing the problem itself.
With that experience, I tend to think this may have to do with memory use. I do not know whether Jupyter or Gurobi is designed to give an error message when the memory use is high or the program is running out of memory or at least terminate with a special status code so that we know this happened because of memory shortage. Since I couldn't find such information online, I assume that there is no special status code or error message generated in this case.
What I would like to do now is to see how I can control the memory use of the original problem and see if it improves the behavior. Do you have any tips for that?
Best regards,
Buddi
0 -
Hi Buddi,
In case you don't have enough memory for both Gurobi and matplotlib at the same time, I recommend cleaning up the Gurobi model after the optimization is finished and you have stored the solution information. This should free up enough memory for other tasks.
You can do this by wrapping the entire optimization code in a function and only return the solution values, or by explicitly deleting the model (del model).
I hope that helps.
Cheers,
Matthias0
投稿コメントは受け付けていません。
コメント
4件のコメント