I'm successfully creating, training and evaluating a model.
When invoking I'm getting the stacktrace below.
The repository is created in my HF account (with a .gitattributes via an initial commit).
This function will save, evaluate, generate a video of your agent,
create a model card and push everything to the hub. It might take up to 1min.
This is a work in progress: if you encounter a bug, please open an issue.
/usr/local/lib/python3.8/dist-packages/stable_baselines3/common/evaluation.py:65: UserWarning: Evaluation environment is not wrapped with a ``Monitor`` wrapper. This may result in reporting modified episode lengths and rewards, if other wrappers happen to modify these. Consider wrapping environment first with ``Monitor`` wrapper.
warnings.warn(
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
[<ipython-input-41-aa4aae99d08a>](https://localhost:8080/#) in <module>
25
26 # method save, evaluate, generate a model card and record a replay video of your agent before pushing the repo to the hub
---> 27 package_to_hub(model=model, # Our trained model
28 model_name=model_name, # The name of our trained model
29 model_architecture=model_architecture, # The model architecture we used: in our case PPO
9 frames
[/usr/local/lib/python3.8/dist-packages/huggingface_sb3/push_to_hub.py](https://localhost:8080/#) in package_to_hub(model, model_name, model_architecture, env_id, eval_env, repo_id, commit_message, is_deterministic, n_eval_episodes, token, video_length, logs)
373
374 # Step 4: Generate a video
--> 375 _generate_replay(model, replay_env, video_length, is_deterministic, tmpdirname)
376
377 # Step 5: Generate the model card
[/usr/local/lib/python3.8/dist-packages/huggingface_sb3/push_to_hub.py](https://localhost:8080/#) in _generate_replay(model, eval_env, video_length, is_deterministic, local_path)
134 )
135
--> 136 obs = env.reset()
137 lstm_states = None
138 episode_starts = np.ones((env.num_envs,), dtype=bool)
[/usr/local/lib/python3.8/dist-packages/stable_baselines3/common/vec_env/vec_video_recorder.py](https://localhost:8080/#) in reset(self)
66 def reset(self) -> VecEnvObs:
67 obs = self.venv.reset()
---> 68 self.start_video_recorder()
69 return obs
70
[/usr/local/lib/python3.8/dist-packages/stable_baselines3/common/vec_env/vec_video_recorder.py](https://localhost:8080/#) in start_video_recorder(self)
78 )
79
---> 80 self.video_recorder.capture_frame()
81 self.recorded_frames = 1
82 self.recording = True
[/usr/local/lib/python3.8/dist-packages/gym/wrappers/monitoring/video_recorder.py](https://localhost:8080/#) in capture_frame(self)
130
131 render_mode = "ansi" if self.ansi_mode else "rgb_array"
--> 132 frame = self.env.render(mode=render_mode)
133
134 if frame is None:
[/usr/local/lib/python3.8/dist-packages/stable_baselines3/common/vec_env/dummy_vec_env.py](https://localhost:8080/#) in render(self, mode)
85 """
86 if self.num_envs == 1:
---> 87 return self.envs[0].render(mode=mode)
88 else:
89 return super().render(mode=mode)
[/usr/local/lib/python3.8/dist-packages/gym/core.py](https://localhost:8080/#) in render(self, mode, **kwargs)
293
294 def render(self, mode="human", **kwargs):
--> 295 return self.env.render(mode, **kwargs)
296
297 def close(self):
[/usr/local/lib/python3.8/dist-packages/gym/envs/box2d/lunar_lander.py](https://localhost:8080/#) in render(self, mode)
386
387 def render(self, mode="human"):
--> 388 from gym.envs.classic_control import rendering
389
390 if self.viewer is None:
[/usr/local/lib/python3.8/dist-packages/gym/envs/classic_control/rendering.py](https://localhost:8080/#) in <module>
25
26 try:
---> 27 from pyglet.gl import *
28 except ImportError as e:
29 raise ImportError(
[/usr/local/lib/python3.8/dist-packages/pyglet/gl/__init__.py](https://localhost:8080/#) in <module>
233 elif compat_platform == 'darwin':
234 from .cocoa import CocoaConfig as Config
--> 235 del base # noqa: F821
236
237
NameError: name 'base' is not defined