You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kurt Wilson 3326c4677d fix typo 4 years ago
.idea Made scripts GUI compatible and addied run functionality to GUI 5 years ago
build-gui-Desktop-Release Added Training Timer for Start button in GUI. 5 years ago
docker add sagemaker setup, set RTIS track as default 4 years ago
gui Added Training Timer for Start button in GUI. 5 years ago
overrides Update 5 years ago
profiles Updated profiles directory with correct base info 5 years ago
scripts fix typo 4 years ago
.gitignore Improved memory-manager start and fixed log save for profile system 5 years ago Merge pull request #55 from kohtet02/master 4 years ago add sagemaker setup, set RTIS track as default 4 years ago set to download RTIS tracks 4 years ago


Provides a quick and easy way to get up and running with a local deepracer training environment using Docker Compose. This repo just creates a wrapper around the amazing work done by Alex found here: This repo adds some additional functionanlity such as a GUI and a lot of under-the-hood improvements. Please refer to his repo to understand more about what's going on under the covers. For additional help, submit an issue or join the deepracer slack for some more support.

Video Instructions

Video Instructions

Getting Started


  • This project is specifically built to run on Ubuntu 18.04 with an Nvidia GPU. It is assumed you already have CUDA/CUDNN installed and configured.

  • You also need to have Docker installed as well as the Nvidia-Docker runtime.

  • You should have an AWS account with the AWS cli installed. The credentials should be located in your home directory (~/.aws/credentials)

  • ensure you have vncviewer installed

NOTE: If you already have these prerequisites setup then you can simply run the script described in the Initialization section. If you are setting everything up for the first time, then the information provided here can help you to get your environment ready to use this repo.

Local Environment Setup

If you are running Windows and would like to use this repo, you will need to modify the process to get everything to run on Windows (not recommended as you will not be able to take advantage of the GPU during training) Many users have found it useful to dual-boot (Windows/Linux). There are many tutorials online for how to do this. You can follow the instructions provided below as guidance.

* Installing Ubuntu 18.04 with Windows 10

When it gets to the Disk Management part, to make space for your Ubuntu installation, followed this guide and specifically look at the 2nd method (MiniTool Partition Wizard):

* Installing the AWS CLI
pip install -U awscli

Then Follow this:

* Installing Docker-ce (steps from )
sudo apt-get remove docker docker-engine containerd runc
sudo apt-get update

  sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \

curl -fsSL | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
  sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli

Verify docker works

sudo docker run hello-world
3. Installing Docker-compose (from )
curl -L`uname -s`-`uname -m` -o     /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Verify installation

docker-compose --version
NOTE: You can also choose to install docker-compose via another package manager (i.e. pip or conda), but if you do, make sure to do so in a virtual env. Many OSs have python system packages that conflict with docker-compose dependencies.

Additionally, make sure your user-id can run docker without sudo (from )

sudo groupadd docker
sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated.

And configure Docker to start on boot.

sudo systemctl enable docker
* Preparing for nvidia-docker

The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docker containers.
Nvidia-docker essentially exposes the GPU to the containers to use:

You may want to note what you have installed currently.

    sudo apt list --installed | grep nvidia

Then prepare for clean installation of Nvidia drivers.

    sudo apt-get purge nvidia*  
Installing nvidia-docker runtime (from )
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L | sudo apt-key add -
curl -s -L$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install nvidia-docker2
sudo pkill -SIGHUP dockerd
* Installing the proper nvidia drivers

Check for driver version here according to your GPU(s): In the dropdown for OS, choose “show all OSs” to see if there are Ubuntu specific choices. Otherwise choose Linux. If you get a dropdown for “cuda toolkit”, choose 10.0)

sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt install nvidia-driver-410 && sudo reboot 
NOTE: 410 is a driver version that is compatible with the GPU I selected on the Nvidia website.

Verify the driver installation:

nvcc --version  
* Installing VNC viewer on your local machine

This doc is straight forward:

Using the GUI

We've made a GUI to make training locally as simple as possible. Follow this guide for using the GUI. If you are receiving segmentation fault errors try rebuilding the GUI using qmake and make in the /gui directory. Then rerun ./gui to see if your problem has been fixed. If you have problems with the log analysis tool make sure that you have installed virtualenv for python. sudo apt-get install virtualenv

Training timer setting for start button is added. Now you can train your model with 5, 10, 30, 60, 90, 120 mins to prevent training too much and overfitting problem. If you cancel the Training Time setting dialog, the training will set to 60 mins default.

Training Manually

NOTE: You can apparently use Anaconda instead to install CUDA/CUDNN. I have not tried this, however some users have and have reported that this method is much easier. If you use this approach, you will need to first install Anaconda. Once installed you can then use the conda package manager to install the desired versions of CUDA and cuDNN. The following installation configuration has been reported to work together successfully
Downloading Anaconda
sudo apt-get update -y && sudo apt-get upgrade -y
cd /tmp/
sudo wget
Installing Anaconda
"yes" for using the default directory location
“yes” for running conda init
Activating Anaconda
source ~/.bashrc
Verifying the conda package manager works
conda list
Installing CUDA/CUDNN
conda install cudnn==7.3.1 && conda install -c fragcolor cuda10.0


This guide was built to run on Ubuntu 18.04. We know it runs on Ubuntu 16.04, and there's reports on it running on OS X and Windows as well, if you've managed to make it run on those platforms, submit a issue ticket and let us know, we'd love to know how you did it!

Follow these guides for setting up the environment and getting started:

11. Run from this repo (refer to the rest of this doc for script details)

In a command prompt, simply run "./". This will set everything up so you can run the deepracer local training environment. performs these steps so you don't have to do them manually:

  1. Clones Chris's repo:
  2. Does a mkdir -p ~/.sagemaker && cp config.yaml ~/.sagemaker
  3. Sets the image name in to "crr0004/sagemaker-rl-tensorflow:nvidia”
  4. Also sets the instance_type in to “local_gpu”
  5. Copies the and model-metadata files into your Minio bucket

To start or stop the local deepracer training, use the scripts found in the scripts directory.

Here is a brief overview of the available scripts:


  • training

      • starts the whole environment using docker compose
      • it will also open a terminal window where you can monitor the log output from the sagemaker training directory
      • it will also automatically open vncviewer so you can watch the training happening in Gazebo
      • For the make sure to enter your user password into the opened terminal in order to run the program in sudo
      • stops the whole environment
      • automatically finds and stops the training container which was started from the sagemaker container
      • uploads a specific snapshot to S3 in AWS. If no checkpoint is provided, it attempts to retrieve the latest snapshot
      • renames the last training run directory from rl-deepracer-sagemaker to rl-deepracer-pretrained so that you can use it as a starting point for a new training run.
      • (WARNING: this script deletes files on your system. I take no responsibility for any resulting actions by running this script. Please look at what the script is doing before running it so that you understand)
      • deletes the last training run including all of the snapshots and log files. You will need sudo to run this command.
  • evaluation

      • starts the whole environment using docker compose to run an evaluation run
      • it will also open a terminal window where you can monitor the log output from the sagemaker training directory
      • it will also automatically open vncviewer so you can watch the training happening in Gazebo
      • stops the whole environment
      • automatically finds and stops the training container which was started from the sagemaker container
  • log-analysis

      • starts a container with Nvidia-Docker running jupyter labs with the log analysis notebooks which were originally provided by AWS and then extended by Tomasz Ptak
      • the logs from robomaker are automatically mounted in the container so you don't have to move any files around
      • in order to get to the container, look at the log output from when it starts. You need to grab the URL including the token query parameter and then paste it into the brower at localhost:8888.
      • stops the log-analysis container

Uploading to the DeepRacer League

Once you've trained your model, you can upload your model to be evaluated and submitted to the DeepRacer league. Follow the guide linked below:


You can modify training hyperparameters from the file

Action Space & Reward Function

The action-space and reward function files are located in the deepracer-for-dummies/docker/volumes/minio/bucket/custom_files directory

Track Selection

The track selection is controled via an environment variable in the .env file located in the deepracer-for-dummies/docker directory