You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frompyoptinterfaceimportgurobidefmake_model():
env=gurobi.Env(empty=True)
# env.set_raw_parameter("some_key", "some_value")env.start()
returngurobi.Model(m)
m=make_model()
# m.close() ## Uncommenting this line fixes the issue.
The above code outputs the following warning when the program exits:
Warning: environment still referenced so free is deferred (Continue to use WLS)
This could be avoided by closing the model before the environment is freed. It would be nice for pyoptinterface to do this so that users don't need to.
Note: this only happens with using Gurobi's Web License Server (WLS) not when using a named academic license.
The text was updated successfully, but these errors were encountered:
importgurobipyasgpoptions= {
"WLSACCESSID": "",
"WLSSECRET": "",
"LICENSEID": 0,
}
# use wls# env = gp.Env(params=options)# use local licenseenv=gp.Env()
model=gp.Model(env=env)
env.dispose()
The problem is that Gurobi chooses to keep the environment alive if its created model is still alive only for WLS. I do not think we should add more complexity to deal with this issue like recording the models created by which environment and destroy them before the env.
Like the official docs said: "Users should dispose of all models created in this environment before disposing of this Env object."
Uh oh!
There was an error while loading. Please reload this page.
The above code outputs the following warning when the program exits:
This could be avoided by closing the model before the environment is freed. It would be nice for pyoptinterface to do this so that users don't need to.
Note: this only happens with using Gurobi's Web License Server (WLS) not when using a named academic license.
The text was updated successfully, but these errors were encountered: