ShangtongZhang / DeepRL

Modularized Implementation of Deep RL Algorithms in PyTorch
MIT License
3.21k stars 686 forks source link

Rendering with DummyVecEnv #55

Closed Marianoetchart closed 5 years ago

Marianoetchart commented 5 years ago

Hi I would like to render with DummyVecEnv but I get an error back saying it has not been implemented from baselines/common/vec_env/vec_env.py. How would I go about to implement rendering. Here is the traceback, any help would be appreciated:

Traceback (most recent call last):
  File "examples.py", line 473, in <module>
    dqn_pixel_atari(game)
  File "examples.py", line 80, in dqn_pixel_atari
    evaluate_game.evaluate_game(DRQNAgent(config),log, name)
  File "/home/mariano/Documents/DeepRL-0.3/evaluate_game.py", line 18, in evaluate_game
    task.render()
  File "/home/mariano/Documents/DeepRL-0.3/deep_rl/component/envs.py", line 203, in render
    return self.env.render()
  File "/home/mariano/Documents/DeepRL-0.3/baselines/baselines/common/vec_env/vec_env.py", line 111, in render
    imgs = self.get_images()
  File "/home/mariano/Documents/DeepRL-0.3/baselines/baselines/common/vec_env/vec_env.py", line 125, in get_images
    raise NotImplementedError
NotImplementedError
ShangtongZhang commented 5 years ago

Unfortunately I don't know. I assume it will be easy, you can just delegate the rendering from subprocess to the main process.

Marianoetchart commented 5 years ago

Figured it out, thanks for the quick reply!