Training Obstacle Tower Agent Using Dopamine

Environment:
Linux: Ubuntu 16.04
Python: 3.6.8

Step 1
Create a conda virtual environment with your virtual environment name(e.g. venv_dopamine)
conda create -n venv_dopamine python=3.6.8 anaconda

Step 2
Activate the virtual environment
conda activate venv_dopamine

Step 3
Move to the virtual environment directory
cd venv_dopamine

Step 4
Install the Obstacle Tower Environment
git clone https://github.com/Unity-Technologies/obstacle-tower-env

Step 5
cd obstacle-tower-env
pip install ./
cd ..

Step 6
Download Obstacle Tower Executables
wget https://storage.googleapis.com/obstacle-tower-build/v1.3/obstacletower_v1.3_linux.zip

Step 7
Extract the downloaded Obstacle Tower environment
unzip obstacletower_v1.3_linux.zip

Step 8
Install Dopamine

Step 8.1
Install Dopamine Dependencies
sudo apt update
sudo apt install cmake zlib1g-dev
pip install absl-py atari-py gin-config gym opencv-python

Step 8.2
Download Dopamine Repository
git clone https://github.com/google/dopamine.git
pip install absl-py atari-py gin-config gym opencv-python tensorflow-gpu

Step 9
Making Dopamine compatible with Obstacle Tower
Install the files that enable Dopamine to interact with the Obstacle Tower files. Download and extract those files.
wget https://storage.googleapis.com/obstacle-tower-build/dopamine/dopamine_otc.zip
unzip dopamine_otc.zip

Step 10
Place unity_lib.py in dopamine/dopamine/discrete_domains
cp dopamine_otc/unity_lib.py dopamine/dopamine/discrete_domains/unity_lib.py

Step 11
Place rainbow_otc.gin in a convenient location, e.g. dopamine/dopamine/agents/rainbow/configs.
cp dopamine_otc/rainbow_otc.gin dopamine/dopamine/agents/rainbow/configs/rainbow_otc.gin

Step 12
rainbow_otc.gin file contains the configuration for training the Rainbow agent in Obstacle Tower Environment Modify it as per your need.

Step 13
Training with Dopamine. Move to the dopamine directory and start the training
cd ./dopamine
python -um dopamine.discrete_domains.train –base_dir=/tmp/dopamine –gin_files=‘dopamine/agents/rainbow/configs/rainbow_otc.gin’

Step 14
If faced with problem of ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
Find whether the file exist or not
locate libcublas.so.10.0
Set the LD_LIBRARY_PATH environment variable to the path for locate libcublas.so.10.0 using export command
e.g. export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64/
If the the file libcublas.so.10.0 is not found then look for which version of libcublas you have on your system and set the LD_LIBRARY_PATH to that folder.
Install compatible version of Tensorflow
Rerun the command to start the training.

python -um dopamine.discrete_domains.train –base_dir=/tmp/dopamine –gin_files=‘dopamine/agents/rainbow/configs/rainbow_otc.gin’

Avatar
Saroj Panda
PhD Student Computer Science

Related