DongChen06 / MARL_CAVs

MARL for Autonomous Vehicles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

something wrong with the reset() function

PeiyanFlying opened this issue · comments

I got this error when I tried to run either run_xxx.py or mpc_main.py. It looks like somewhere in the observation is a little bit glitchy. Would you mind helping me to look at it? It seems that there are some values which are out of the range [-1,1] or the dimension is not right. Thank you!

Screenshot from 2022-07-01 20-09-15
Screenshot from 2022-07-01 20-00-26

could you provide more details, since I haven't come across this issue before?

Screenshot from 2022-07-01 20-27-17
(should be the thing start with the array, the line above is the args = parse_args())
This is what I got for the observation and the observation space is an spaces.Box object and it looks like it's in the highway_env/envs/common
class KinematicObservation
def space(self) -> spaces.Space:
return spaces.Box(shape=(self.vehicles_count, len(self.features)), low=-1, high=1, dtype=np.float32)

It seems like this error is saying that the result of the env.reset() is not in the env.observation_space, which is a KinematicObservation, with spaces.Box(shape=(self.vehicles_count, len(self.features)), low=-1, high=1, dtype=np.float32) as the characteristic, and looks like self.vehicles_count = 5, len(self.features) = 5.

A quick try: try to use gym==0.15.4

Screenshot from 2022-07-01 21-43-58
Screenshot from 2022-07-01 21-39-07

This issue was solved, but I get another error...

have you changed any settings?

I don't think so. But it works for mpc_main.py! Yet tried to re-download the directory with run_xxx.py and they still give me this issue.

@PeiyanFlying Have you addressed the issue. I tested the repo again and did not find any issues with the default requirements. If you still face the issue, you may send me an email and then we can address it together.

Sorry for the late reply! it worked after I updated my pytorch to the corresponding version of my nvidia setting. Thank you very much!