huggingface / huggingface/deep-rl-class
[UPDATE] untit1 hands on - add " render_mode='rgb_array' " to gym.make when initiating eval_env
- Dominant language
- MDX
- Stars
- 5k
- Forks
- 811
- PR merge metrics
- No merged PRs in 30d
Description
# What do you want to improve?
unit1 hands on
- Explain the typo/error or the part of the course you want to improve
I encountered the error "AssertionError: The render_mode must be 'rgb_array', not None" when I tried pushing my agent to the hf hub.
to avoid this, we should add " render_mode='rgb_array' " in gym.make when initiating the eval_env
so the entire code cell should be :
```
# Create a new environment for evaluation
eval_env = Monitor(gym.make("LunarLander-v2", render_mode='rgb_array'))
# Evaluate the model with 10 evaluation episodes and deterministic=True
mean_reward, std_reward = evaluate_policy(model, eval_env, n_eval_episodes=10, deterministic=True)
# Print the results
print(f"mean_reward={mean_reward:.2f} +/- {std_reward}")
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.