You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the code for the render function in brax.envs.wrappers.gym.VectorGymWrapper is wrong. The code is intended only to render the first environment and not all environments. In case of gym/gymansium, vector envs render all environments at the same time. The error comes on this line
The issue is that pipeline_state does not implement take.
The code can be fixed by replacing the line with the following:
defrender(self, mode='human'):
ifmode=='rgb_array':
sys, state=self._env.sys, self._stateifstateisNone:
raiseRuntimeError('must call reset or step before rendering')
# Change this line to return (env_num, height, width, 3)returnnp.stack([image.render_array(sys, state.take(i).pipeline_state, 256, 256) foriinrange(self.num_envs)])
else:
returnsuper().render(mode=mode) # just raise an exception
This will return an ndarray with images stacked for each environment.
The text was updated successfully, but these errors were encountered:
It seems that the code for the render function in
brax.envs.wrappers.gym.VectorGymWrapper
is wrong. The code is intended only to render the first environment and not all environments. In case of gym/gymansium, vector envs render all environments at the same time. The error comes on this lineThe issue is that
pipeline_state
does not implementtake
.The code can be fixed by replacing the line with the following:
This will return an ndarray with images stacked for each environment.
The text was updated successfully, but these errors were encountered: