SLM Lab
Search…
Installation

💽
Installing SLM Lab

Clone the repository:
1
git clone https://github.com/kengz/SLM-Lab.git
Copied!
Install the dependencies:
1
cd SLM-Lab/
2
./bin/setup
Copied!
This runs a prepared bash script with the necessary setup steps, with Python dependencies managed through Conda. Refer to the Help page if you encounter issues.
Readers of the book
📖
Foundations of Deep Reinforcement Learning: please see this custom instruction page.

Alternative Installations

Bring-your-own-PyTorch/GPU

SLM Lab uses PyTorch version 1.3.1 by default. For newer GPU cards, the versions of PyTorch and CUDA that come with SLM Lab default setup above may not be supported. In this case, you may bring-your-own-PyTorch by using environment-byo.yml to setup dependencies instead. This installs the same Python modules except for PyTorch and cudatoolkit. Use the following commands:
1
# first install the system dependencies
2
sudo apt-get update && \
3
apt-get install -y build-essential \
4
curl nano git wget zip libstdc++6 \
5
python3-dev zlib1g-dev libjpeg-dev cmake swig python-pyglet python3-opengl libboost-all-dev libsdl2-dev libosmesa6-dev patchelf ffmpeg xvfb && \
6
rm -rf /var/lib/apt/lists/*
7
8
# setup Conda environment and install everything except PyTorch and cudatoolkit
9
conda create -n lab python=3.7.3 -y
10
conda env update -f environment-byo.yml
11
# install your own pytorch from https://pytorch.org/get-started/locally/
12
conda activate lab
13
conda install pytorch==1.7.1 cudatoolkit=11.0 -c pytorch
Copied!
Thanks to @Karl-Grantham for help with testing this on RTX A6000 and RTX A5000 GPUs.

Windows

The best way to run SLM Lab on Windows is to use a Bash shell/Linux subsystem. Credit to @vladimirnitu and @steindaian for providing a detailed instruction PDF for doing so on Windows:
SLM_for_Windows.pdf
190KB
PDF
SLM Lab for Windows (Instruction PDF)

Google Colab/Jupyter Notebook

Although we do not recommend running SLM Lab on Google Colab or Jupyter notebooks (notebooks come with inherent limitations, e.g. no rendering/multi-processing), we have prepared an example notebook for illustration. Credit to @piosif97 for helping with this:
For details on how it works, refer to this Help section.

🖥
Hardware Requirements

Non-image based environments can run on a laptop. Only image based environments such as the Atari games benefit from a GPU speedup. For these, we recommend 1 GPU and at least 4 CPUs. This can run a single Atari Trial consisting of 4 Sessions.
For desktop, a reference spec is GTX 1080 GPU, 4 CPUs above 3.0 GHz, and 32 GB RAM.
For cloud computing, start with an affordable instance of AWS EC2 p2.xlarge with a K80 GPU and 4 CPUs. Use the Deep Learning AMI with Conda when creating an instance.