brendanator / atari-rl

Atari - Deep Reinforcement Learning algorithms in TensorFlow
MIT License
135 stars 31 forks source link

AttributeError: 'FastAtariEnv' object has no attribute '_buffer #3

Open ashimko opened 6 years ago

ashimko commented 6 years ago

Thanks for sharing such a cool thing!

But I have an another issue in master branch:

AttributeError: 'FastAtariEnv' object has no attribute '_buffer'

2018-05-21 21:24:06 MainThread: Populating replay memory
Traceback (most recent call last):
  File "main.py", line 171, in <module>
    tf.app.run()
  File "/home/alexshim/anaconda3/envs/py35_rl_gpu/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 134, in main
    trainer.train()
  File "/home/alexshim/py_packs/atari-rl/agents/training.py", line 32, in train
    self.train_agent(session, self.agents[0])
  File "/home/alexshim/py_packs/atari-rl/agents/training.py", line 56, in train_agent
    agent.populate_replay_memory()
  File "/home/alexshim/py_packs/atari-rl/agents/agent.py", line 77, in populate_replay_memory
    if done: self.new_game()
  File "/home/alexshim/py_packs/atari-rl/agents/agent.py", line 20, in new_game
    observation, reward, done = self.atari.reset()
  File "/home/alexshim/py_packs/atari-rl/atari/atari.py", line 43, in reset
    self.last_frame = self.env.reset()
  File "/home/alexshim/py_packs/gym/gym/envs/atari/atari_env.py", line 100, in reset
    return self._get_obs()
  File "/home/alexshim/py_packs/gym/gym/envs/atari/atari_env.py", line 94, in _get_obs
    img = self._get_image()
  File "/home/alexshim/py_packs/atari-rl/atari/atari.py", line 110, in _get_image
    self.ale.getScreenRGB(self._buffer)  # says rgb but actually bgr
AttributeError: 'FastAtariEnv' object has no attribute '_buffer'

Can be it caused newer version of openai/atari? What version should I use?

ashimko commented 6 years ago

@brendanator can you help to resolve this issue? I would like to use some of results in my course work. But I am not shure, that I could write such a good code by myself...

XieKaixuan commented 6 years ago

@ashimko You can try to comment out the definition of FastAtariEnv class in atari.py, and use AtariEnv instead of FastAtariEnv in the create_env function.