Skip to content

Instantly share code, notes, and snippets.

@carpedm20
Last active June 20, 2016 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carpedm20/2035298fdc3313e16aae0c6bb690bada to your computer and use it in GitHub Desktop.
Save carpedm20/2035298fdc3313e16aae0c6bb690bada to your computer and use it in GitHub Desktop.
DQN-tensorflow writeup

DQN-tensorflow

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
@Sessa93
Copy link

Sessa93 commented Jun 17, 2016

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

@carpedm20
Copy link
Author

@Sessa93 You need a bigger memory to run this model. My server has 32GB memory but 16GB should be enough. How much memory do you have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment