araffin / learning-to-drive-in-5-minutes

Implementation of reinforcement learning approach to make a car learn to drive smoothly in minutes
https://towardsdatascience.com/learning-to-drive-smoothly-in-minutes-450a7cdb35f4
MIT License
287 stars 87 forks source link

Not connecting to simulator SDSandbox v 20.5.16 #29

Open josiahcoad opened 4 years ago

josiahcoad commented 4 years ago

Hello, I am trying to run your code exactly as is (using your pretrained agent and vae) and just get :"Waiting for sim to start...if the simulation is running, press EXIT to go back to menu.". I also tried setting the export DONKEY_SIM_PATH environment variable but to no avail.

Code example

python enjoy.py --algo sac -vae vae-level-0-dim-32.pkl --exp-id 6 -n 2000

System Info Describe the characteristic of your environment:

araffin commented 4 years ago

Hello, There is one important info that is missing: what simulator are you using? And did you launch it before launching the script?

josiahcoad commented 4 years ago

Using donkey sim "SDSandbox v 20.5.16". I've tried several things:

  1. launching sim before running script (without setting env var DONKEY_SIM_PATH)
  2. not launching sim before running script (with setting env var DONKEY_SIM_PATH) Both of these result in the error mentioned above
  3. launching sim before running script (with setting env var DONKEY_SIM_PATH) which results in thread errors due to conflicting processes
araffin commented 4 years ago

Using donkey sim "SDSandbox v 20.5.16". I've tried several things:

This is a newer version compared to the one tested. Did you try using the one from the README?

araffin commented 4 years ago

I've got an internal pytorch version working with "SDSandbox v 20.5.16" and SB3, I planned to open source it at some point.

In the meantime, you can take a look at https://github.com/tawnkramer/gym-donkeycar to see what have changed in the api of the simulator. The logic is different: the simulator is the server instead of the client now.

josiahcoad commented 4 years ago

Oh I see, that's unfortunate. the linked sim in the README is just for linux (unless I were to build it myself). Looking forward to your next release!

araffin commented 4 years ago

You can also try older binaries from the release page: https://github.com/tawnkramer/gym-donkeycar/releases

September 2018 may work: https://github.com/tawnkramer/gym-donkeycar/releases/tag/v18.9

There are binaries for Linux, Mac and Windows.

josiahcoad commented 4 years ago

Well, I did get a different result. Now I get (after setting the env var DONKEY_SIM_PATH but without launching the sim first)

...
Waiting for sim to start...if the simulation is running, press EXIT to go back to the menu
Got a new client ('127.0.0.1', 58585)
Scene Selection Ready
Connection dropped
Waiting for sim to start...if the simulation is running, press EXIT to go back to the menu
...