This repository contains a behavioural cloning baseline solution for the MineRL BASALT 2022 Competition ("basalt" track)! This solution fine-tunes the "width-x1" models of OpenAI VPT for more sample-efficient training.
You can find the "intro" track baseline solution here.
MineRL BASALT is a competition on solving human-judged tasks. The tasks in this competition do not have a pre-defined reward function: the goal is to produce trajectories that are judged by real humans to be effective at solving a given task.
See the AICrowd competition page for further details on the competition.
You can find the index files containing all the download URLs for the full BASALT dataset in the OpenAI VPT repository at the bottom.
We have included a download utility (utils/download_dataset.py
) to help you download the dataset. You can use it with the index files from the OpenAI VPT repository. For example, if you download the FindCave dataset index file, named find-cave-Jul-28.json
, you can download first 100 demonstrations to MineRLBasaltFindCave-v0
directory with:
python download_dataset.py --json-file find-cave-Jul-28.json --output-dir MineRLBasaltFindCave-v0 --num-demos 100
Basic dataset statistics (note: one trajectory/demonstration may be split up into multiple videos):
Size #Videos Name
--------------------------------------------------
146G 1399 MineRLBasaltBuildVillageHouse-v0
165G 2833 MineRLBasaltCreateVillageAnimalPen-v0
165G 5466 MineRLBasaltFindCave-v0
175G 4230 MineRLBasaltMakeWaterfall-v0
Install MineRL v1.0.0 (or newer) and the requirements for OpenAI VPT.
Download the dataset following above instructions. Also download the 1x width foundational model .weights and .model files for the OpenAI VPT model.
Place these data files under data
to match the following structure:
├── data
│ ├── MineRLBasaltBuildVillageHouse-v0
│ │ ├── Player70-f153ac423f61-20220707-111912.jsonl
│ │ ├── Player70-f153ac423f61-20220707-111912.mp4
│ │ └── ... rest of the files
│ ├── MineRLBasaltCreateVillageAnimalPen-v0
│ │ └── ... files as above
│ ├── MineRLBasaltFindCave-v0
│ │ └── ... files as above
│ ├── MineRLBasaltMakeWaterfall-v0
│ │ └── ... files as above
│ └── VPT-models
│ ├── foundation-model-1x.model
│ └── foundation-model-1x.weights
Running following code will save a fine-tuned network for each task under train
directory. This has been tested to fit into a 8GB GPU.
python train.py
To run the trained model for MineRLBasaltFindCave-v0
, run the following:
python run_agent.py --model data/VPT-models/foundation-model-1x.model --weights train/MineRLBasaltFindCave.weights --env MineRLBasaltFindCave-v0 --show
Change FindCave
to other tasks to run for different tasks.
Note: This repository is not submittable as-is. You first need to train the models, add them to the git repository and then submit to AICrowd.
To submit this baseline agent follow the submission instructions, but use this repo instead of the starter kit repo.