如何解决PulpSolverError:“PuLP:执行 glpsol.exe 时出错”纸浆测试All() 产生此错误消息:“CBC 提供了一个错误的热启动解决方案”
在使用 PuLP 求解时遇到“PulpSolverError: PuLP: Error while execution glpsol.exe”问题。
---------------------------------------------------------------------------
PulpSolverError Traceback (most recent call last)
<ipython-input-8-2777eb898bca> in <module>
28 file.write("\n% of Customers {:.1f}" .format(j*100))
29 print ('\n% of Customers within the service distance: ',j*100,'%')
---> 30 df_assign_vars[j],list_facility_vars[j],number_of_warehouses[j] = optimal_location(service_level,j,service_level_par,warehouses,customers,customer_demands,distance,scenario_name)
31 if output_inline == True:
32 output_visual_inline(number_of_warehouses)
<ipython-input-3-5775a28a71f6> in optimal_location(service_level,sl_customers,scenario_name)
63
64 # The problem is solved using PuLP's choice of Solver
---> 65 germany_problem.solve()
66 #germany_problem.solve(use_mps=False)
67
~\Anaconda3\lib\site-packages\pulp\pulp.py in solve(self,solver,**kwargs)
1897 #time it
1898 self.solutionTime = -clock()
-> 1899 status = solver.actualSolve(self,**kwargs)
1900 self.solutionTime += clock()
1901 self.restoreObjective(wasNone,dummyVar)
~\Anaconda3\lib\site-packages\pulp\apis\glpk_api.py in actualSolve(self,lp)
91
92 if not os.path.exists(tmpSol):
---> 93 raise PulpSolverError("PuLP: Error while executing "+self.path)
94 status,values = self.readsol(tmpSol)
95 lp.assignVarsVals(values)
PulpSolverError: PuLP: Error while executing glpsol.exe
使用pulpTestAll() 进行了检查并收到此错误消息
C:\Users\<username>\Anaconda3\lib\site-packages\pulp\tests\test_pulp.py:325: UserWarning:
CBC gives a wrong solution with warmStart.
感谢您的帮助!尝试重新安装 PuLP,但同样的问题仍然存在
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。