This project is focused on training reinforcement learning models to play Minecraft, with the ultimate goal of successfully playing through the game and defeating the Ender Dragon using only reinforcement learning techniques. The repository's name reflects this objective.
Currently, the training script supports training CNN models for simple tasks. I'm also developing a feature to use Optuna for automatic hyperparameter tuning. The PPO training script is based on the CleanRL implementation, and MineDojo is used as the training environment.
Follow these steps to set up the project. It is recommended to use a virtual environment such as venv
or conda
.
-
Set Up MineDojo:
- Refer to the MineDojo installation guide.
- If you choose to install directly:
- Use Python 3.9.5 for compatibility.
- Downgrade
pip
,setuptools
, andwheel
using the following commands:pip install pip==23.1 pip install setuptools==65.5.0 "wheel<0.40.0"
- You might encounter Gradle build errors when running
run_training.bat
. Here are some potential error messages and their solutions:- If you encounter an error related to
MixinGradle-dcfaf61
, refer to the GitHub issue for a solution. - For errors related to
mcpbot
, check the solution provided here. - If certain classes fail to download, it might be due to inactive download sources. Search for a mirror source hosting the class file and add it to the Maven section in
minedojo/sim/Malmo/Minecraft/build.gradle
in your MineDojo installation directory. - If these solutions do not resolve your issue, consult the MineDojo or Malmo issue trackers.
At this rate, I’ll master Docker and Gradle just from setting up this project!
- If you encounter an error related to
-
Install Requirements:
- Run the following command in the project root directory:
pip install -r requirements.txt
- Run the following command in the project root directory:
- Run the launch script to start training:
run_training.bat
- View TensorBoard statistics:
run_tensorboard.bat