Skip to main content

Model too large for size-limited license

Answered

Comments

2 comments

  • Eli Towle
    Gurobi Staff Gurobi Staff

    Your code is very close! You first create a Gurobi environment named \(\texttt{env}\) using your WLS license credentials, then associate that environment to a Model object called \(\texttt{model}\):

    with gp.Env(params=options) as env, gp.Model(env=env) as model:

    The \(\texttt{model}\) Model properly uses your WLS license. The problem comes from the next line of code, where you create a second Model object \(\texttt{m1}\) that is not associated with the \(\texttt{env}\) environment:

        m1 = gp.Model("Fair_regression")

    Because you do not pass an environment to the Model() constructor, Gurobi looks for a license file on your machine. It does not find one, and instead relies on the size-limited license file included in the \(\texttt{gurobipy}\) installation. Thus, model \(\texttt{m1}\) is restricted by this size-limited license.

    To fix the issue, make sure the model you solve is associated with the \(\texttt{env}\) environment:

    with gp.Env(params=options) as env, gp.Model("Fair_regression", env=env) as m1:
        ...
        m1.optimize()
    0
  • Yutian He
    Conversationalist
    First Question

    Thank you so much Eli, that works!

    0

Please sign in to leave a comment.