stanfordnmbl/osim-rl

ValueError while executing act_and_train in TRPO

mcmips opened this issue · 1 comments

Traceback (most recent call last):
File "TRPO.py", line 169, in
action = agent.act_and_train(obs, reward)
File "C:\Anaconda3\envs\osim-rl2\lib\site-packages\chainerrl\agents\trpo.py", line 680, in act_and_train
b_state = self.obs_normalizer(b_state, update=False)
File "C:\Anaconda3\envs\osim-rl2\lib\site-packages\chainerrl\links\empirical_normalization.py", line 93, in call
mean = xp.broadcast_to(self._mean, x.shape)
File "<array_function internals>", line 6, in broadcast_to
File "C:\Anaconda3\envs\osim-rl2\lib\site-packages\numpy\lib\stride_tricks.py", line 180, in broadcast_to
return _broadcast_to(array, shape, subok=subok, readonly=True)
File "C:\Anaconda3\envs\osim-rl2\lib\site-packages\numpy\lib\stride_tricks.py", line 125, in _broadcast_to
op_flags=['readonly'], itershape=shape, order='C')
ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (1,158) and requested shape (1,160)

please help.. any hints are welcome..

length of obs returned me 160, so i assume req shape is (1,160)

I see that
obs_space = env.observation_space
returns a space size of (158)

any hints, how can i fix this while using google colab for this code.