opendilab / DI-drive

Decision Intelligence Platform for Autonomous Driving simulation.
https://opendilab.github.io/DI-drive/
Apache License 2.0
569 stars 58 forks source link

how to train the simple rl #7

Closed Wasedarocket closed 2 years ago

Wasedarocket commented 2 years ago

Hi, when I train the simple rl, I start the carla in a terminator with "./CarlaUE4.sh --carla-world-port=9000" and another terminator with "python demo/simple_rl/dqn_train.py". And I have install the DI-engine,Carla, and set the pythonpath.

And I got: ERROR:root:VEC_ENV_MANAGER: env 1 reset error ERROR:root: Env Process Reset Exception: File "xxxxx/anaconda2/envs/di_drive/lib/python3.7/site-packages/ding/envs/env_manager/subprocess_env_manager.py", line 382, in _reset reset_fn() File "/home/xxxx/anaconda2/envs/di_drive/lib/python3.7/site-packages/ding/envs/env_manager/subprocess_env_manager.py", line 371, in reset_fn raise Exception("env reset timeout") # Leave it to retry_wrapper to try again Exception('env reset timeout') ERROR:root:VEC_ENV_MANAGER: env 3 reset error ERROR:root: Env Process Reset Exception: File "/home/xxxx/anaconda2/envs/di_drive/lib/python3.7/site-packages/ding/envs/env_manager/subprocess_env_manager.py", line 382, in _reset reset_fn() File "/home/xxxxx/anaconda2/envs/di_drive/lib/python3.7/site-packages/ding/envs/env_manager/subprocess_env_manager.py", line 371, in reset_fn raise Exception("env reset timeout") # Leave it to retry_wrapper to try again Exception('env reset timeout') ERROR:root:VEC_ENV_MANAGER: env 4 reset error ERROR:root:

How to fix this problem? Did I forget to set some parameters? Thank you very much

RobinC94 commented 2 years ago

Hi! By default the entry code will try to find 5 Carla servers. If you want to make it work you should either change the env_num and server key of the config dict in entry file, or start 5 Carla servers which ports from 9000 to 9008.