DongChen06 / MARL_CAVs

MARL for Autonomous Vehicles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

f"The second element returned by `env.reset()` was not a dictionary, actual type: {type(info)}"

jhih-ching-yeh opened this issue · comments

Excuse me, your code is so clear, so I want to run your code to learn MARL.
However, I ran into the trouble with the following description.

Traceback (most recent call last):
File "run_mappo.py", line 227, in <module>
train(args)
File "run_mappo.py", line 123, in train
episodes_before_train=EPISODES_BEFORE_TRAIN, traffic_density=traffic_density
File "/home/sunny_yeh/MARL_CAVs-main/MARL/MAPPO.py", line 46, in __init__
self.env_state, self.action_mask = self.env.reset()
File "/home/sunny_yeh/anaconda3/envs/marl_cav/lib/python3.6/site-packages/gym/wrappers/order_enforcing.py", line 42, in reset
return self.env.reset(**kwargs)
File "/home/sunny_yeh/anaconda3/envs/marl_cav/lib/python3.6/site-packages/gym/wrappers/env_checker.py", line 45, in reset
return env_reset_passive_checker(self.env, **kwargs)
File "/home/sunny_yeh/anaconda3/envs/marl_cav/lib/python3.6/site-packages/gym/utils/passive_env_checker.py", line 207, in env_reset_passive_checker
),
f"The second element returned by env.reset() was not a dictionary, actual type: {type(info)}"
AssertionError: The second element returned by env.reset() was not a dictionary, actual type: <class 'numpy.ndarray'>

I think it's probably because "gym" version, so maybe you can share your version to me.
Thanks a lot

Hi, thanks for your interest. could you please try 0.21.0 or 0.19.0?

gym-0.21.0不能用怎么办

Hi, could you try similar versions to see what will happen?