Git Product home page Git Product logo

chrome-dino-reinforcement-learning's Introduction

Chrome-Dino-Reinforcement-Learning

NOTE: This repo is the basic implementation with few limitations. Please refer the new repo at https://github.com/Paperspace/DinoRunTutorial

https://blog.paperspace.com/dino-run/

A Deep Convolutional Neural Network to play Google Chrome's offline Dino Run game by learning action patterns from visual input using a model-less Reinforcement Learning Algorithm

NOTE: This is a basic-implementation repository with some limitations. Please refer https://github.com/Paperspace/DinoRunTutorial where I've used a GPU VM for better results, with scores upto 4000

Refer the jupyter notebook for detailed implementation :
https://github.com/ravi72munde/Chrome-Dino-Reinforcement-Learning/blob/master/Reinforcement%20Learning%20Dino%20Run.ipynb

Installation

Start by cloning the repository

$ git clone https://github.com/ravi72munde/Chrome-Dino-Reinforcement-Learning.git
Dependencies can be installed using pip install or conda install for Anaconda environment

Dependencies

  • Python 3.6
  • Selenium
  • OpenCV
  • PIL
  • Keras
  • Chromium driver for Selenium

gif

Sample Game Play

https://youtu.be/0oOOqGFmlDs

chrome-dino-reinforcement-learning's People

Contributors

ravi72munde avatar tristansokol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chrome-dino-reinforcement-learning's Issues

seems the D.pkl is missing?


FileNotFoundError Traceback (most recent call last)
in ()
----> 1 playGame(observe=True);

in playGame(observe)
5 model = buildmodel()
6 try:
----> 7 trainNetwork(model,game_state,observe=observe)
8 except StopIteration:
9 game.end()

in trainNetwork(model, game_state, observe)
9 last_time = time.time()
10 # store the previous observations in replay memory
---> 11 D = load_obj("D") #load from file system
12 # get the first state by doing nothing
13 do_nothing = np.zeros(ACTIONS)

in load_obj(name)
4
5 def load_obj(name ):
----> 6 with open('objects/' + name + '.pkl', 'rb') as f:
7 return pickle.load(f)
8 def grab_screen(_driver = None):

FileNotFoundError: [Errno 2] No such file or directory: 'objects/D.pkl'

Doubt on javascript

Thanks for this article. I didn’t understand how did you know Runner is for checking the state like current score, gamer running or not, crashed or not, resume, start, …

Is that present in every canvas game? Mean did it work only for chrome://dino ? How can I find out Runner kind of variable to check the game state in other websites?

File not found issue.

/usr/local/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Now we build the model
We finish building the model
Traceback (most recent call last):
File "Chrome-dino.py", line 444, in
playGame(observe=False);
File "Chrome-dino.py", line 373, in playGame
trainNetwork(model,game_state,observe=observe)
File "Chrome-dino.py", line 223, in trainNetwork
D = load_obj("D") #deque()
File "Chrome-dino.py", line 155, in load_obj
with open('objects/' + name + '.pkl', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'objects/D.pkl'

The above is my terminal log, I am trying to run it in mac, looking forward if someone can help me resolve this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.