Open StephenWelch opened 1 year ago
render_mode='human'
The environment errors on the first call to reset() with the following stacktrace:
reset()
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[2], line 3 1 seed = 0 2 env = cartpole_env.CartPoleEnv(render_mode="human") ----> 3 env.reset(seed) 4 rng = np.random.default_rng(seed=0) 5 generator = torch.Generator(device=device) File ~/code/research/mbrl-lib/mbrl/env/cartpole_continuous.py:124, in CartPoleEnv.reset(self, seed) 122 self.steps_beyond_terminated = None 123 if self.render_mode == "human": --> 124 self.render() 125 return np.array(self.state), {} File ~/code/research/mbrl-lib/mbrl/env/cartpole_continuous.py:216, in CartPoleEnv.render(self) 214 if self.render_mode == "human": 215 pygame.event.pump() --> 216 self.clock.tick(self.metadata["render_fps"]) 217 pygame.display.flip() 219 elif self.render_mode == "rgb_array": KeyError: 'render_fps'
The pygame window opens but displays nothing.
The environment should display in a window.
In the PETS Example notebook:
env = cartpole_env.CartPoleEnv(render_mode="human")
Steps to reproduce
render_mode='human'
Observed Results
The environment errors on the first call to
reset()
with the following stacktrace:The pygame window opens but displays nothing.
Expected Results
The environment should display in a window.
Relevant Code
In the PETS Example notebook: