Model too large for size-limited license despite WLS license
AnsweredHello,
I have a web application that makes use of a WLS license to create and solve optimization models, and until 2 weeks ago everything was working perfectly. I didn't use my application for two weeks, and now I am getting the following error, even though nothing changed: "An error occurred during optimization: Model too large for size-limited license; visit https://www.gurobi.com/free-trial for a full license".
The license expires in March 2024. I pass the credentials via parameters to the Gurobi environment directly, and when I write them down it shows the credentials of the license perfectly. I even tried generating a new license file with new credentials but it didn't change anything.
I pass the parameters as follows:
def read_gurobi_license_from_secrets():
license_data = {
'WLSACCESSID': st.secrets['WLSACCESSID'],
'WLSSECRET': st.secrets['WLSSECRET'],
'LICENSEID': int(st.secrets['LICENSEID']) # Cast to int because secrets are loaded as strings
}
return license_data
def init_gurobi_env_from_secrets():
license_data = read_gurobi_license_from_secrets()
env = gp.Env(params=license_data)
return env
env = init_gurobi_env_from_secrets()
[...]
trains_scheduling_ordered, equipment_scheduling = milp_stage_1_and_2_app(df1,earliest_arrival,end_date_latest_arrival,env)
And the function milp_stage_1_and_2_app is defined as follows:
def milp_stage_1_and_2_app(df1,earliest_arrival,end_date_latest_arrival,env):
[rest of the code to create and solve the model]
return(trains_scheduling_ordered,equipment_scheduling)
It was working perfectly until now so I really don't know what is going wrong... Any help would be extremely appreciated. Thank you!
-
Hi Alexandre,
Could you show us the Gurobi output? Does it show license messages referring to your WLS license?
Could you also show us the line that creates the model?Best regards,
Mario0 -
Thanks to your message I found the problem!
I was creating the model with:
m = gp.Model("multi_objective_model")
And not:
m = gp.Model("multi_objective_model",env=env)
Thank you!
0 -
Thanks for reporting the solution! This might be helpful for others, too!
0
Please sign in to leave a comment.
Comments
3 comments