Closed nithin127 closed 6 years ago
You should provide a little more context about what you were trying to do, and where in the program you put those print statements. I added some new tests, and everything seems fine on my end:
https://github.com/duckietown/gym-duckietown/blob/master/run_tests.py#L19
I repatriated the PyTorch observation wrapper into the gym-duckietown
codebase so we can use it with other RL code, and added tests:
https://github.com/duckietown/gym-duckietown/blob/master/gym_duckietown/wrappers.py#L30
So, I'm trying to run python main.py
on
https://github.com/nithin127/pytorch-a2c-ppo-acktr
And I get the following error:
Traceback (most recent call last): File "main.py", line 224, in <module> main() File "main.py", line 112, in main update_current_obs(obs) File "main.py", line 109, in update_current_obs current_obs[:, -shape_dim0:] = obs RuntimeError: The expanded size of the tensor (120) must match the existing size (160) at non-singleton dimension 3
Basically;
obs.shape
gives (8, 3, 120, 160)
env.observation_space
gives Box(3, 160, 120)
The changes I made were giving the env.observation_space
gives Box(3, 120, 160)
Which made sure there was no error..
So, I've added tests, and this is not the result I get on my end: https://github.com/duckietown/gym-duckietown/blob/master/run_tests.py#L24
Which version of Python and which version of PyTorch are you running?
I was getting the following
o = env.reset(); o.shape
Result: (3, 120, 160)env.observation_space
Result: Box(3,160,120)So I made some changes.. hope these are consistent with the rest of the code