Shuijing725 / CrowdNav_DSRNN

[ICRA 2021] Decentralized Structural-RNN for Robot Crowd Navigation with Deep Reinforcement Learning
https://sites.google.com/illinois.edu/crowdnav-dsrnn/home
MIT License
95 stars 23 forks source link

AssertionError: action space does not inherit from `gym.spaces.Space` #21

Closed grlinnn closed 1 year ago

grlinnn commented 1 year ago

Hi!

I had following output when running the train.py file.

2023-03-05 17:18:49, INFO: Create other envs with new settings Logging to C:\Users\Lab404\AppData\Local\Temp\openai-2023-03-05-17-18-49-452472 Creating dummy env object to get spaces Traceback (most recent call last): File "d:\LGR\RL\CrowdNav_DSRNN-main\CrowdNav_DSRNN-main\train.py", line 248, in main() File "d:\LGR\RL\CrowdNav_DSRNN-main\CrowdNav_DSRNN-main\train.py", line 88, in main envs = make_vec_envs(env_name, config.env.seed, config.training.num_processes, File "d:\LGR\RL\CrowdNav_DSRNN-main\CrowdNav_DSRNN-main\pytorchBaselines\a2c_ppo_acktr\envs.py", line 112, in make_vec_envs envs = ShmemVecEnv(envs, context='spawn') File "d:\LGR\RL\CrowdNav_DSRNN-main\CrowdNav_DSRNN-main\pytorchBaselines\a2c_ppo_acktr\shmem_vec_env.py", line 37, in init dummy = env_fns[0]() File "d:\LGR\RL\CrowdNav_DSRNN-main\CrowdNav_DSRNN-main\pytorchBaselines\a2c_ppo_acktr\envs.py", line 40, in _thunk env = gym.make(env_id) File "D:\downloads\PythonInstall\lib\site-packages\gym\envs\registration.py", line 669, in make env = PassiveEnvChecker(env) File "D:\downloads\PythonInstall\lib\site-packages\gym\wrappers\env_checker.py", line 23, in init check_action_space(env.action_space) File "D:\downloads\PythonInstall\lib\site-packages\gym\utils\passive_env_checker.py", line 74, in check_space raise AssertionError( AssertionError: action space does not inherit from 'gym.spaces.Space', actual type: <class 'NoneType'>

Note: I change envs = ShmemVecEnv(envs, context='fork') become envs = ShmemVecEnv(envs, context='spawn') because I had an error if I stick to "fork", and source on the internet said that fork is for MacOS, and I use Windows OS.

Do you have any idea on how to solve this?

Thank you!

grlinnn commented 1 year ago

Excuse me, do you remember what version of gym you used?

Thank you!

grlinnn commented 1 year ago

problem solved with installing gym==0.20.0

Shuijing725 commented 1 year ago

Thanks for letting me know. The requirements.txt is updated.