Using Keras and Deep Q-Network to Play FlappyBird
Clone or download
Latest commit 26cceb4 Apr 4, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets First Upload Jul 12, 2016
game fixed TabError: inconsistent use of tabs and spaces in indentation Dec 8, 2017 update Jul 12, 2016
animation1.gif new pic Jul 12, 2016
model.h5 update for tensorflow Mar 14, 2017
model.json First Upload Jul 12, 2016 normalize Apr 4, 2018


A single 200 lines of python code to demostrate DQN with Keras

Please read the following blog for details

Installation Dependencies:

  • Python 2.7
  • Keras 1.0
  • pygame
  • scikit-image

How to Run?

CPU only

git clone
cd Keras-FlappyBird
python -m "Run"

GPU version (Theano)

git clone
cd Keras-FlappyBird
THEANO_FLAGS=device=gpu,floatX=float32,lib.cnmem=0.2 python -m "Run"

If you want to train the network from beginning, delete the model.h5 and run -m "Train"