|
2 | 2 |
|
3 | 3 | ### Requirements Overview
|
4 | 4 | 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. |
7 | 7 |
|
8 | 8 | ### 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. |
10 | 10 | Requires Docker Desktop, with Nvidia Container Toolkit set up.
|
11 | 11 |
|
12 | 12 | 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. |
14 | 14 |
|
15 |
| -The resulting container is 7.7 GB. |
| 15 | +The resulting container is 7.3 GB. |
16 | 16 |
|
17 | 17 | ### 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. |
19 | 19 | ```
|
20 |
| -conda create -n poke-rl-torch python=3.8 |
| 20 | +conda create -n poke-rl-torch python=3.11 |
21 | 21 | 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 |
24 | 24 | ```
|
25 | 25 | Once installed, in basic_rl.ipynb be sure to change ```"tf2"``` to ```"torch"``` in the line:
|
26 | 26 | ```python
|
|
0 commit comments