メインコンテンツへスキップ

Model too large for size-limited license

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Eli Towle
    • 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
    • Gurobi-versary
    • Curious
    • Conversationalist

    Thank you so much Eli, that works!

    0

投稿コメントは受け付けていません。