Kaixhin / PlaNet

Deep Planning Network: Control from pixels by latent planning with learned dynamics
MIT License
365 stars 59 forks source link

pyglet error (No display) #11

Closed juliusfrost closed 5 years ago

juliusfrost commented 5 years ago

Hi, I am getting the following error message. I am running this on a gpu server.

(planet) [juliusf@______ PlaNet]$ python main.py
                          Options
                          id: default
                          seed: 1
                          disable_cuda: False
                          env: Pendulum-v0
                          symbolic_env: False
                          max_episode_length: 1000
                          experience_size: 1000000
                          activation_function: relu
                          embedding_size: 1024
                          hidden_size: 200
                          belief_size: 200
                          state_size: 30
                          action_repeat: 2
                          action_noise: 0.3
                          episodes: 1000
                          seed_episodes: 5
                          collect_interval: 100
                          batch_size: 50
                          chunk_size: 50
                          overshooting_distance: 50
                          overshooting_kl_beta: 0
                          overshooting_reward_scale: 0
                          global_kl_beta: 0
                          free_nats: 3
                          bit_depth: 5
                          learning_rate: 0.001
                          learning_rate_schedule: 0
                          adam_epsilon: 0.0001
                          grad_clip_norm: 1000
                          planning_horizon: 12
                          optimisation_iters: 10
                          candidates: 1000
                          top_candidates: 100
                          test_interval: 25
                          test_episodes: 10
                          checkpoint_interval: 50
                          checkpoint_experience: False
                          load_experience: False
                          load_checkpoint: 0
                          render: False
Traceback (most recent call last):
  File "main.py", line 90, in <module>
    observation, done, t = env.reset(), False, 0
  File "/scratch/juliusf/PlaNet/env.py", line 106, in reset
    return _images_to_observation(self._env.render(mode='rgb_array'), self.bit_depth)
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/gym/core.py", line 230, in render
    return self.env.render(mode, **kwargs)
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/gym/envs/classic_control/pendulum.py", line 82, in render
    return self.viewer.render(return_rgb_array = mode=='rgb_array')
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/gym/envs/classic_control/rendering.py", line 104, in render
    image_data = buffer.get_image_data()
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/image/__init__.py", line 2155, in get_image_data
    self.gl_format, GL_UNSIGNED_BYTE, buffer)
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/gl/lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'
Exception ignored in: <function Viewer.__del__ at 0x7f857b720598>
Traceback (most recent call last):
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/gym/envs/classic_control/rendering.py", line 152, in __del__
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/gym/envs/classic_control/rendering.py", line 71, in close
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py", line 480, in close
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/gl/xlib.py", line 345, in destroy
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/gl/base.py", line 334, in destroy
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/gl/xlib.py", line 335, in detach
  File "/scratch/juliusf/anaconda3/envs/planet/lib/python3.7/site-packages/pyglet/gl/lib.py", line 97, in errcheck
ImportError: sys.meta_path is None, Python is likely shutting down
Kaixhin commented 5 years ago

Can you run a DM Control environment with visual observations outside of this code? If not then you should raise an issue here.

juliusfrost commented 5 years ago

I'll close this until I have time to do it

juliusfrost commented 5 years ago

Fixed this by using a virtual display. (VNC)