0

I'm calling the visikit frontend.py to plot the reward after 100 iterations.

But I got the error:

 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

I cannot locate the issue here. Basically, I am following the tutorial instructions. Does anyone have insights?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Pao Raw
  • 37
  • 6

1 Answers1

1

It looks like the combination of your IP address (localhost) and port number (5000) is already being used by some other processes (because of OSError: [Errno 98] Address already in use)

I think most probably this is because of running the frontend.py script multiple times or maybe in 2 terminals. Please close ("quit") all terminals, maybe wait for a few seconds, and run the script again. (also, open your browser and go to http://localhost:5000 and see what is there)

If this does not work, you have to see why the port 5000 is in-use. Try these:

Who is listening on a given TCP port on Mac OS X?

Find (and kill) process locking port 3000 on Mac

Ashkan
  • 238
  • 1
  • 10