DongChen06 / MARL_CAVs

MARL for Autonomous Vehicles
240 stars 45 forks source link

something wrong with the reset() function #11

Closed PeiyanFlying closed 2 years ago

PeiyanFlying commented 2 years ago

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

DongChen06 commented 2 years ago

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

PeiyanFlying commented 2 years ago

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)

PeiyanFlying commented 2 years ago

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.

DongChen06 commented 2 years ago

A quick try: try to use gym==0.15.4

PeiyanFlying commented 2 years ago

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...

DongChen06 commented 2 years ago

have you changed any settings?

PeiyanFlying commented 2 years ago

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.

DongChen06 commented 2 years ago

@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.

PeiyanFlying commented 2 years ago

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