Error with callback expample in python: Unable to read model

133 views
Skip to first unread message

evelyn...@ucn.cl

unread,
Mar 28, 2019, 4:49:28 PM3/28/19
to Gurobi Optimization
Unable to open file '-f' for input
---------------------------------------------------------------------------
GurobiError                               Traceback (most recent call last)
<ipython-input-15-b36f173ce915> in <module>()
     87 # Read model from file
     88 
---> 89 model = read(sys.argv[1])
     90 
     91 # Open log file

gurobi.pxi in gurobipy.read()

gurobi.pxi in gurobipy.gurobi.read()

GurobiError: Unable to read model

zinc...@gurobi.com

unread,
Mar 28, 2019, 4:50:16 PM3/28/19
to Gurobi Optimization
Did you supply a valid model file name as an argument to the Python script?


Evelyn Arrey González

unread,
Mar 28, 2019, 7:15:29 PM3/28/19
to gur...@googlegroups.com
I used an example of “gurobi examples”.
It is callback.py 
This is the link: 

El El jue, 28 de mar. de 2019 a las 17:50, zinchenko via Gurobi Optimization <gur...@googlegroups.com> escribió:
Did you supply a valid model file name as an argument to the Python script?


--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
  











unnamed4.png Evelyn Arrey González

Académico
Departamento de Ingeniería Industrial
Facultad de Ingeniería y Ciencias Geológicas
Universidad Católica del Norte
Av. Angamos 0610, of. Y1-316, Antofagasta
+56 55 235 5153
   ✉ evelyn.arrey@ucn.cl
industrial.ucn.cl 

Michael Winkler

unread,
Mar 28, 2019, 9:40:32 PM3/28/19
to Gurobi Optimization
Hi Evelyn,

It seems you are calling callback.py with an command line option "-f",  likely "callback.py -f mymodel.mps". The -f option is not something we use, could you please double check that you call it just like "callback.py mymodel.mps".

Best,
Michael

Evelyn Arrey González

unread,
Mar 29, 2019, 1:22:51 PM3/29/19
to gur...@googlegroups.com
Hi Michael and thanks

I try with that and i still have the same problem.

and i think in this part is the error:
image.png
  











unnamed4.png Evelyn Arrey González

Académico
Departamento de Ingeniería Industrial
Facultad de Ingeniería y Ciencias Geológicas
Universidad Católica del Norte
Av. Angamos 0610, of. Y1-316, Antofagasta
+56 55 235 5153
   ✉ evelyn.arrey@ucn.cl
industrial.ucn.cl 

--

Michael Winkler

unread,
Apr 1, 2019, 4:34:35 AM4/1/19
to Gurobi Optimization
How do you execute the script?

Best,
Michael
Reply all
Reply to author
Forward
0 new messages