First, clone the project:
git clone https://github.com/devsisters/DQN-tensorflow/
cd DQN-tensorflow
To train a model for Breakout:
python main.py --env_name=Breakout-v0 --is_train=True
python main.py --env_name=Breakout-v0 --is_train=True --display=True
To test and record the screen with gym (the repo already contains checkpoint):
python main.py --is_train=False
python main.py --is_train=False --display=True
The best model can be obtained for 10M iteration with:
python main.py --env_name=Breakout-v0 --is_train=True --model=m2
I cannot reproduce:
i get a MemoryError on:
Traceback (most recent call last): File "main.py", line 63, in <module> tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 30, in run sys.exit(main(sys.argv)) File "main.py", line 50, in main agent = Agent(config, env, sess) File "/env/deep27/DQN-tensorflow/dqn/agent.py", line 22, in __init__ self.memory = ReplayMemory(self.config, self.model_dir) File "/env/deep27/DQN-tensorflow/dqn/replay_memory.py", line 18, in __init__ self.screens = np.empty((self.memory_size, config.screen_height, config.screen_width), dtype = np.float16) MemoryError