Code Monkey home page Code Monkey logo

sonic-ai's Introduction

Sonic-AI

Prerequisite:

  • Ubuntu
  • Python 3
  • Make virtual environment
python3 -m venv venv

Setup (Linux)

  1. Activate virtual environment
. venv/bin/activate
  1. Install baselines dependencies
sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev
  1. Install Tensorflow
  • Choice A: For CPU (slower)
pip install tensorflow==1.14.0
  • Choice B: For Nvidia Cuda GPU (faster)
pip install tensorflow-gpu==1.14.0
  1. Install baselines (Current baselines in pip is outdated)
pip install git+https://github.com/openai/baselines.git
  1. Install Other dependencies
pip install -r requirements.txt
  1. Import sonic roms
python -m retro.import ./Roms
  1. Install retro-contest
git clone --recursive https://github.com/openai/retro-contest.git
pip install -e "retro-contest/support[docker,rest]"

Training model

python train.py

Monitoring

Monitoring is done through tensorboard. To run TensorBoard run the command below, make sure venv is activated

tensorboard --logdir ./tb_log

This will run tensorboard, and tensorboard will search for Events from the specified directory

Play sonic with trained model

Replace saved_model_filename with actual name of the saved model zip file. E.g. sonic_stable_dqn.zip

python play.py saved_model_filename

python slow_play.py saved_model_filename

Hall of Fame

Models that has successfully completed a level are stored inside saved_models

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.