Skip to content

Commit e561118

Browse files
authored
Merge pull request #3 from Microgorath/python-3-11
Improve config support, tune default config hyperparameters
2 parents 9272165 + e84c2f8 commit e561118

File tree

3 files changed

+164
-124
lines changed

3 files changed

+164
-124
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
33
{
44
"name": "poke-rl",
5-
"image": "tensorflow/tensorflow:2.13.0-gpu-jupyter",
5+
"image": "tensorflow/tensorflow:2.15.0-gpu-jupyter",
66

7-
"runArgs": ["--gpus=all"
7+
"runArgs": ["--gpus=all",
8+
"--shm-size=50gb"
89
],
910

1011
// Features to add to the dev container. More info: https://containers.dev/features.
1112
// "features": {},
1213

1314
// Use 'forwardPorts' to make a list of ports inside the container available locally.
14-
// TODO: Add pokemon showdown local server installation and setup. Showdown uses port 8000 by default.
15-
// Set Jupyter notebook to use port 8888, if necessary.
15+
// Showdown uses port 8000 by default.
1616
"forwardPorts": [8000],
1717

1818
// Uncomment the next line to run commands after the container is created.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
### Requirements Overview
44
This notebook uses RLLib, an open-source scalable reinforcement learning library in the Ray framework.
5-
RLLib currently only supports Python 3.8.
6-
RLLib supports both PyTorch and Tensorflow, so either may be used. Preferably, the library used will be CUDA-enabled to utilize the GPU, but it is optional. Nvidia GPU support only.
5+
RLLib currently supports Python 3.9 - 3.12.
6+
RLLib supports both PyTorch and Tensorflow, so either may be used. This setup will assume GPU will be used, but it is not necessary for most algorithms. Training with GPU was found to be slightly slower than only using CPU for DQN. GPU use is most likely only useful for large models that take longer for inference or backprop.
77

88
### Tensorflow GPU Support
9-
A dev container is provided that will set up a Linux Tensorflow 2.13.0-gpu-jupyter Docker container with everything set up for Tensorflow GPU support, which also starts its own local pokemon showdown server when started. The showdown server is port forwarded to be visible on the host, at http://localhost:8000.
9+
A dev container is provided that will set up a Linux Tensorflow 2.15.0-gpu-jupyter Docker container with everything set up for Tensorflow GPU support, which also starts its own local pokemon showdown server when started. The showdown server is port forwarded to be visible on the host, at http://localhost:8000.
1010
Requires Docker Desktop, with Nvidia Container Toolkit set up.
1111

1212
If on Windows, also requires WSL2. Follow [this guide](https://gdevakumar.medium.com/setup-windows-10-11-machines-for-deep-learning-with-docker-and-gpu-using-wsl-9349f0224971) to set up Docker Desktop with WSL2 and Nvidia Container Toolkit. The CUDA toolkit version installed on the local WSL2 does not matter, as the Docker image installs its own CUDA Toolkit and cuDNN automatically.
13-
Currently, Tensorflow 2.13 is the most recent version supported by RLLib, which requires specifically CUDA Toolkit 11.8 and cuDNN 8.6. As of Tensorflow 2.11, using GPU on Windows is not supported, thus why WSL2 is required.
13+
As of Tensorflow 2.11, using GPU on Windows is not supported, thus why WSL2 is required.
1414

15-
The resulting container is 7.7 GB.
15+
The resulting container is 7.3 GB.
1616

1717
### PyTorch GPU Support
18-
PyTorch works just fine, without needing WSL2 or Docker. Training time is about the same as Tensorflow, but has very limited Tensorboard support. Set up PyTorch with GPU support however you would normally on a new Conda environment. Here I will be using CUDA 12.1, but any version that works with Python 3.8 should be fine.
18+
PyTorch works just fine, without needing WSL2 or Docker. Training time is about the same as Tensorflow, but has very limited Tensorboard support. Set up PyTorch with GPU support however you would normally on a new Conda environment.
1919
```
20-
conda create -n poke-rl-torch python=3.8
20+
conda create -n poke-rl-torch python=3.11
2121
conda activate poke-rl-torch
22-
pip3 install torch --index-url https://download.pytorch.org/whl/cu121
23-
pip install -r requirements.txt
22+
pip3 install --user torch --index-url https://download.pytorch.org/whl/cu121
23+
pip3 install --user -r requirements.txt
2424
```
2525
Once installed, in basic_rl.ipynb be sure to change ```"tf2"``` to ```"torch"``` in the line:
2626
```python

0 commit comments

Comments
 (0)