[使用Pyomo在NEOS服务器中调用求解器后如何访问日志文件的内容?

问题描述 投票:1回答:1

我正在使用Pyomo从NEOS服务器运行BONMIN求解器。但是,它返回一个简单的日志文件,没有任何有用的信息,例如迭代次数。您能让我知道如何检索完整的日志文件吗?Pyomo中的代码如下:

opt_prob = pyomo.opt.SolverFactory(bonmin, solver_io = minlp)
opt_prob.options['max_iter']    = self.max_iter
opt_prob.options['tol']         = self.tol
solver_manager = pyomo.opt.SolverManagerFactory('neos')
results = solver_manager.solve(self.model, keepfiles=True, tee=True, opt=opt_prob)

现在的日志文件内容如下:Job 6915952 dispatched password: lBdrJjXS ---------- Begin Solver Output ----------- Condor submit: 'neos.submit' Condor submit: 'watchdog.submit' Job submitted to NEOS HTCondor pool.

using logfile pyomo neos-server
1个回答
0
投票

不确定此问题是否仍然需要回答,但是将日志文件保存在外部会有所帮助吗?

因此添加:

results = solver_manager.solve(self.model, keepfiles=True, tee=True, opt=opt_prob, logfile = "name.csv")
© www.soinside.com 2019 - 2024. All rights reserved.