Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hw1 dosen't work on colab #9

Open
whoiscjq opened this issue Nov 19, 2024 · 1 comment
Open

Hw1 dosen't work on colab #9

whoiscjq opened this issue Nov 19, 2024 · 1 comment

Comments

@whoiscjq
Copy link

When running the code

#@title test virtual display

#@markdown If you see a video of a four-legged ant fumbling about, setup is complete!

import gym
from cs285.infrastructure.colab_utils import (
    wrap_env,
    show_video
)

env = wrap_env(gym.make("Ant-v4", render_mode='rgb_array'))

observation = env.reset()
for i in range(100):
    env.render()
    obs, rew, term, _ = env.step(env.action_space.sample() )
    if term:
      break;

env.close()
print('Loading video...')
show_video()

It shows:

/usr/local/lib/python3.10/dist-packages/gym/wrappers/record_video.py:75: UserWarning: WARN: Overwriting existing videos at /content/video folder (try specifying a different `video_folder` for the `RecordVideo` wrapper if this is not desired)
  logger.warn(
---------------------------------------------------------------------------
FatalError                                Traceback (most recent call last)
[<ipython-input-26-07246415da83>](https://localhost:8080/#) in <cell line: 13>()
     11 env = wrap_env(gym.make("Ant-v4", render_mode='rgb_array'))
     12 
---> 13 observation = env.reset()
     14 for i in range(100):
     15     env.render()

10 frames
[/usr/local/lib/python3.10/dist-packages/gym/envs/mujoco/mujoco_rendering.py](https://localhost:8080/#) in __init__(self, model, data, offscreen)
     55         self.vopt = mujoco.MjvOption()
     56         self.pert = mujoco.MjvPerturb()
---> 57         self.con = mujoco.MjrContext(self.model, mujoco.mjtFontScale.mjFONTSCALE_150)
     58 
     59         self._markers = []

FatalError: gladLoadGL error
@whoiscjq
Copy link
Author

Wish to know whether the code still can run on the colab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant