Skip to content

Instantly share code, notes, and snippets.

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 lusob/7b8d6c6414c7b0c1e87c3317b832102e to your computer and use it in GitHub Desktop.
Save lusob/7b8d6c6414c7b0c1e87c3317b832102e to your computer and use it in GitHub Desktop.

Code used to obtain these results can be found at the url https://github.com/lusob/DQN_TensorFlow_OpenAI_Gym

I used TensorFlow for network training and a double deep Q network with memory replay algorithm to optimize a 4 layers neural network.

Intall dependencies

sudo apt-get -y -qq install python-pip python-dev libopencv-dev python-opencv python-scipy python-numpy python-pygame build-essential cmake zlib1g-dev libjpeg-dev libboost-all-dev gcc

Install OpenAI Gym with atari env

pip install gym[atari]

Install TensorFlow

TensorFlow CPU version sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl Or uncommented below line to install TensorFlow GPU version sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

Clone this project

git clone https://github.com/lusob/DQN_TensorFlow_OpenAI_Gym ~/DQN_TF_OpenAI

Start training

python main_multithread_openai.py -visualize n -network_type nature

To eval and record on video a trained model

python main_multithread_openai.py -visualize n -record_eval y -only_eval y -weight ckpt/your_trained_model

You can also set -visualize y to enable video rendering, but it will be slow.

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