错误:求解器(gurobi)返回了非零返回码(1)

时间:2019-01-28 22:33:28

标签: python jupyter-notebook

我正在尝试使用求解器Gurobi求解国家规模的能源模型,但是这个错误出现了,我真的不知道如何求解。

我用求解器glpk尝试了相同的问题一段时间,并且它正在工作,但给出了不可行解决方案的警告。我想修复Gurobi问题,因为我必须至少运行代码一年,而使用glpk则不可行。

[2019-01-28 23:04:26] ERROR: f
[2019-01-28 23:04:26] ERROR: o
[2019-01-28 23:04:26] ERROR: u
[2019-01-28 23:04:26] ERROR: n
[2019-01-28 23:04:26] ERROR: d
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: (
[2019-01-28 23:04:26] ERROR: u
[2019-01-28 23:04:26] ERROR: s
[2019-01-28 23:04:26] ERROR: e
[2019-01-28 23:04:26] ERROR: r
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: z
[2019-01-28 23:04:26] ERROR: e
[2019-01-28 23:04:26] ERROR: q
[2019-01-28 23:04:26] ERROR: i
[2019-01-28 23:04:26] ERROR: r
[2019-01-28 23:04:26] ERROR: ,
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: h
[2019-01-28 23:04:26] ERROR: o
[2019-01-28 23:04:26] ERROR: s
[2019-01-28 23:04:26] ERROR: t
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: P
[2019-01-28 23:04:26] ERROR: C
[2019-01-28 23:04:26] ERROR: ,
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: h
[2019-01-28 23:04:26] ERROR: o
[2019-01-28 23:04:26] ERROR: s
[2019-01-28 23:04:26] ERROR: t
[2019-01-28 23:04:26] ERROR: i
[2019-01-28 23:04:26] ERROR: d
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: c
[2019-01-28 23:04:26] ERROR: 8
[2019-01-28 23:04:26] ERROR: 7
[2019-01-28 23:04:26] ERROR: 6
[2019-01-28 23:04:26] ERROR: 1
[2019-01-28 23:04:26] ERROR: 7
[2019-01-28 23:04:26] ERROR: b
[2019-01-28 23:04:26] ERROR: b
[2019-01-28 23:04:26] ERROR: ,
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: c
[2019-01-28 23:04:26] ERROR: o
[2019-01-28 23:04:26] ERROR: r
[2019-01-28 23:04:26] ERROR: e
[2019-01-28 23:04:26] ERROR: s
[2019-01-28 23:04:26] ERROR: 
[2019-01-28 23:04:26] ERROR: 4
[2019-01-28 23:04:26] ERROR: )
[2019-01-28 23:04:26] ERROR: 
ERROR: Solver (gurobi) returned non-zero return code (1)
ERROR: See the solver log above for diagnostic information.
---------------------------------------------------------------------------
ApplicationError                          Traceback (most recent call last)
<ipython-input-18-640ff0f5af65> in <module>
----> 1 model.run()

~\Miniconda3\pkgs\calliope-0.6.3-py_3\site-packages\calliope\core\model.py in run(self, force_rerun, **kwargs)
    198 
    199         results, self._backend_model, interface = run_backend(
--> 200             self._model_data, self._timings, **kwargs
    201         )
    202 

~\Miniconda3\pkgs\calliope-0.6.3-py_3\site-packages\calliope\backend\run.py in run(model_data, timings, build_only)
     44         results, backend = run_plan(
     45             model_data, timings,
---> 46             backend=BACKEND[run_backend], build_only=build_only
     47         )
     48 

~\Miniconda3\pkgs\calliope-0.6.3-py_3\site-packages\calliope\backend\run.py in run_plan(model_data, timings, backend, build_only, backend_rerun)
     90         results = backend.solve_model(
     91             backend_model, solver=solver,
---> 92             solver_io=solver_io, solver_options=solver_options, save_logs=save_logs
     93         )
     94 

~\Miniconda3\pkgs\calliope-0.6.3-py_3\site-packages\calliope\backend\pyomo\model.py in solve_model(backend_model, solver, solver_io, solver_options, save_logs, **solve_kwargs)
    186     with redirect_stdout(LogWriter('solver', strip=True)):
    187         with redirect_stderr(LogWriter('error', strip=True)):
--> 188             results = opt.solve(backend_model, tee=True, **solve_kwargs)
    189 
    190     return results

~\Miniconda3\lib\site-packages\pyomo\opt\base\solvers.py in solve(self, *args, **kwds)
    594                     logger.error("Solver log:\n" + str(_status.log))
    595                 raise pyutilib.common.ApplicationError(
--> 596                     "Solver (%s) did not exit normally" % self.name)
    597             solve_completion_time = time.time()
    598             if self._report_timing:

ApplicationError: Solver (gurobi) did not exit normally

0 个答案:

没有答案