Skip to content

Commit

Permalink
update dreamerv2 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycaisy committed May 21, 2024
1 parent b74bb8c commit 3907b0f
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
41 changes: 40 additions & 1 deletion dreamerv2/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
TODO
# Guide for Training DreamerV2 on CarDreaner

This guide assumes you have installed ``car_dreamer``. If not, please follow the instructions in the [main README](../README.md).

First, install the required dependencies for DreamerV2:
```bash
cd dreamerv2
conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
pip install -r requirements.txt
```

Set up CARLA and environment variables:
```bash
export CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))
export CUSOLVER_PATH=$(dirname $(python -c "import nvidia.cusolver;print(nvidia.cusolver.__file__)"))
export LD_LIBRARY_PATH=$CUDNN_PATH/lib:$CUSOLVER_PATH/lib:$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
```

## Training

Execute the training script with desired configurations:
```bash
cd ..
bash train_dm2.sh 2000 0 --task carla_four_lane --dreamerv2.logdir ./logdir/carla_four_lane
```

``2000`` is the port number of the CARLA server. The script will automatically start the server so you don't need to start it manually.
``0`` is the GPU number.
``--task`` is the name of the task and ``--dreamerv2.logdir`` is the directory to save the training logs. For a complete list of tasks and their configurations, please refer to the [documentation](https://car-dreamer.readthedocs.io/en/latest/tasks.html).

## Visualization

Online data monitoring can be accessed on website on ``http://localhost:9000/``, where the port number should be changed to ``<carla-port> + 7000`` if you don't use the default port number ``2000`` for CARLA server.

Offline data logging can be accessed through TensorBoard:
```bash
tensorboard --logdir ./logdir/carla_four_lane
```

Go to ``http://localhost:6006/`` in your browser to see the output.
22 changes: 22 additions & 0 deletions dreamerv2/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cloudpickle==3.0.0
crafter==1.8.3
gym==0.12.5
dm_control==1.0.18
jax==0.4.26
jaxlib==0.4.26
numpy==1.24.3
optax==0.2.2
rich==13.7.1
ruamel.yaml==0.18.6
tensorflow[and-cuda]==2.15.1
tensorflow_probability==0.23.0
scikit-image==0.23.2
ffmpeg==1.4
moviepy==1.0.3
imageio==2.34.1
wandb==0.16.6
opencv-python>=4.9,<5.0
shapely==1.8.4
carla==0.9.15
matplotlib==3.8.4
tabulate==0.9.0
6 changes: 3 additions & 3 deletions dreamerv3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Go to ``http://localhost:6006/`` in your browser to see the output.
To use ``wandb`` for visualization, add the WandB logger to ``dreamerv3/train.py``:
```python
logger = embodied.Logger(step, [
# ...
embodied.logger.WandBOutput(logdir.name, config),
])
# ...
embodied.logger.WandBOutput(logdir.name, config),
])
```

Once you log in ``wandb``, put your project and entity name in ``dreamerv3/embodied/logger.py``:
Expand Down
2 changes: 1 addition & 1 deletion dreamerv3/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ crafter==1.8.3
gym==0.12.5
dm_control==1.0.18
jax==0.4.26
jaxlib==0.4.26+cuda12.cudnn89
jaxlib==0.4.26
numpy==1.24.3
optax==0.2.2
rich==13.7.1
Expand Down

0 comments on commit 3907b0f

Please sign in to comment.