0

我正在调用 visikitfrontend.py来绘制 100 次迭代后的奖励。

但我得到了错误:

 WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off

(flow) hao@Hao:~/rllab-multiagent/rllab/viskit$ python frontend.py ~/rllab-multiagent/data/local/hao-stabilizing-highway-0.100/hao_stabilizing_highway_0.100_2019_07_09_20_01_57_0001
Importing data from ['/home/hao/rllab-multiagent/data/local/hao-stabilizing-highway-0.100/hao_stabilizing_highway_0.100_2019_07_09_20_01_57_0001']...
Reading /home/hao/rllab-multiagent/data/local/hao-stabilizing-highway-0.100/hao_stabilizing_highway_0.100_2019_07_09_20_01_57_0001/progress.csv
Reading /home/hao/rllab-multiagent/data/local/hao-stabilizing-highway-0.100/hao_stabilizing_highway_0.100_2019_07_09_20_01_57_0001/gym_log/progress.csv
[Errno 2] No such file or directory: '/home/hao/rllab-multiagent/data/local/hao-stabilizing-highway-0.100/hao_stabilizing_highway_0.100_2019_07_09_20_01_57_0001/gym_log/progress.csv'
Done! View http://localhost:5000 in your browser
 * Serving Flask app "frontend" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
Traceback (most recent call last):
  File "frontend.py", line 580, in <module>
    app.run(host='0.0.0.0', port=args.port, debug=args.debug)
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/site-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/site-packages/werkzeug/serving.py", line 1009, in run_simple
    inner()
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/site-packages/werkzeug/serving.py", line 962, in inner
    fd=fd,
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/site-packages/werkzeug/serving.py", line 805, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/site-packages/werkzeug/serving.py", line 698, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/socketserver.py", line 440, in __init__
    self.server_bind()
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/home/hao/anaconda3/envs/flow/lib/python3.5/socketserver.py", line 454, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

我在这里找不到问题。基本上,我正在按照教程说明进行操作。有没有人有见解?

4

1 回答 1

1

看起来您的 IP 地址 ( localhost) 和端口号 ( 5000) 的组合已被其他一些进程使用(因为OSError: [Errno 98] Address already in use

我认为这很可能是因为frontend.py多次运行脚本或可能在 2 个终端中运行脚本。请关闭(“退出”)所有终端,也许等待几秒钟,然后再次运行脚本。(另外,打开你的浏览器并去http://localhost:5000看看那里有什么)

如果这不起作用,您必须查看端口5000正在使用的原因。试试这些:

谁在 Mac OS X 上的给定 TCP 端口上监听?

在 Mac 上查找(并杀死)进程锁定端口 3000

于 2019-07-10T16:37:22.227 回答