Unreachable server working with GEKKO. What is going on?

☆樱花仙子☆ 提交于 2021-02-10 16:00:44

问题


I'm trying to run / solve my model with GEKKO. Yesterday it was working but today I receive an error with the server.

Does Pyomo need to connect to the server or I can model with it without server connections?

File "C:\ProgramData\Anaconda3\lib\site-packages\gekko\gekko.py", line 2024, in solve raise ImportError('Results files not found. APM did not find a solution or the server is unreachable.')

ImportError: Results files not found. APM did not find a solution or the server is unreachable.


回答1:


You are getting the error message either because the solution was unsuccessful or else because the server or Internet connection to the server is unreliable. If it is a failed solution then you'll see some diagnostics when you set disp=True when you solve m.solve(disp=True). If it is an Internet connection issue or server issue then you can try to switch to a local mode that does not rely on an Internet connection.

By default, Gekko sends the problem to a compute server with 64 CPUs and 64 GB of RAM. When the problem is solved, the solution is sent back to the Python script and continued execution of the script. If you want to run without an Internet connection then use the option remote=False when creating a new model.

1. Local Compute with No Internet Connection

m = GEKKO(remote=False)

Local executables are available for MacOS, Windows, Linux, and Linux ARM (such as Raspberry Pi) but with more limited solver options. The local option is better if an Internet connection is a problem.

2. Local Area Network (LAN) Server

If you want to set up an APMonitor local server in Windows or a local server in Linux (such as on your business LAN), then you can change the default server location and still run with remote=True but with the server option changed to the local server address. The address 127.0.0.1 is localhost if you are running the server on the same computer where you are running the Gekko client.

m = GEKKO(remote=True,server='http://127.0.0.1')

Gekko is set up as in a client / server configuration to allow companies to main and upgrade only a limited number of compute servers. Suppose there are 100 applications running in an oil refinery or for individual turbines on a wind farm. Each Gekko application client resides with the operating unit but connects to the compute server to solve and retrieve solutions. If the Gekko compute server is upgraded on the central system then all of the applications are automatically using the latest version. The local options are needed when data and models should not be shared outside the company. The model is obfuscated by Gekko but many companies have strict regulations on releasing proprietary information without an NDA.

3. Cloud Computing (default)

One of the advantages with using the remote option (default) is that there are more solver options available that cannot be distributed with the local server or local executable.

Summary of Gekko Compute Modes

  1. local computing (with remote=False)
  2. edge computing (server on the local LAN, server=address, remote=True)
  3. cloud computing (external server, default is remote=True)


来源:https://stackoverflow.com/questions/57624215/unreachable-server-working-with-gekko-what-is-going-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!