在排查Gekko输出故障时,如何访问infeasibilities.txt文件?我使用的是m = GEKKO(remote=False),所以我不知道如何在apm_get(server,app,'infeasibilities.txt')函数中使用server和app参数。
发布于 2021-02-20 10:17:21
如果您在公共服务器上使用remote=True进行求解,则可以从服务器检索文件。
from gekko.apm import get_file
print(m._server)
print(m._model_name)
f = get_file(m._server,m._model_name,'infeasibilities.txt')
f = f.decode().replace('\r','')
with open('infeasibilities.txt', 'w') as fl:
fl.write(str(f))如果您使用remote=False解决问题,则不需要从服务器获取文件。它可以在run文件夹m.path中找到,也可以通过m.open_folder()查看。有关How to retrieve the 'infeasibilities.txt' from the gekko的更多详细信息
https://stackoverflow.com/questions/66272522
复制相似问题