forked from Netease-Games-OPD-AI/neural-mmo-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50684f6
commit 2364891
Showing
16 changed files
with
1,978 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,48 @@ | ||
![figure](https://neuralmmo.github.io/_static/banner.png) | ||
# The Winning Solution for the NeurIPS 2023 Neural MMO Challenge | ||
|
||
# ![icon](https://neuralmmo.github.io/_build/html/_images/icon.png) Welcome to the Platform! | ||
This solution is based on the [Neural MMO Baselines](https://github.com/NeuralMMO/baselines/tree/2.0?tab=readme-ov-file). For more information about the challenge, please refer to the [challenge homepage](https://www.aicrowd.com/challenges/neurips-2023-the-neural-mmo-challenge). | ||
|
||
[![](https://dcbadge.vercel.app/api/server/BkMmFUC?style=plastic)](https://discord.gg/BkMmFUC) | ||
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40jsuarez5341)](https://twitter.com/jsuarez5341) | ||
## How to Use | ||
|
||
Baselines repository for Neural MMO. New users should treat this as a starter project. The project is under active development with [Documentation](https://neuralmmo.github.io "Neural MMO Documentation") hosted by github.io. | ||
### Environment Installation | ||
Use `docker/build.sh` to build image for training. | ||
```shell | ||
cd docker | ||
bash build.sh | ||
``` | ||
|
||
![figure](https://neuralmmo.github.io/_build/html/_images/poster.png) | ||
### Run training | ||
Run inside the training container: | ||
```shell | ||
export WANDB_API_KEY=xxx # Change it to yours | ||
WANDB_PROJECT=xxx # Change it to yours | ||
WANDB_ENTITY=xxx # Change it to yours | ||
|
||
export WANDB_DISABLE_GIT=true | ||
export WANDB_DISABLE_CODE=true | ||
|
||
export OMP_NUM_THREADS=4 | ||
|
||
python train.py \ | ||
--runs-dir runs \ | ||
--use-ray-vecenv true \ | ||
--wandb-project $WANDB_PROJECT \ | ||
--wandb-entity $WANDB_ENTITY \ | ||
--model ReducedModelV2 \ | ||
--meander-bonus-weight 0.0 \ | ||
--heal-bonus-weight 0.0 \ | ||
--num-npcs 128 \ | ||
--early-stop-agent-num 0 \ | ||
--resilient-population 0.0 \ | ||
--ppo-update-epochs 1 \ | ||
--train-num-steps 40000000 \ | ||
--num-maps 1280 \ | ||
``` | ||
|
||
### Evaluation | ||
|
||
After training, copy the checkpoints into `policies` and run: | ||
```shell | ||
python evaluate.py -p policies | ||
``` | ||
`policies/submission.pkl` is the trained model we submitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ARG DOCKER_BASE_IMAGE | ||
FROM ${DOCKER_BASE_IMAGE} | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN sudo rm /etc/apt/sources.list.d/* && sudo apt-get update && sudo apt-get install -y vim | ||
|
||
RUN $HOME/anaconda3/bin/pip --no-cache-dir install -r requirements.txt | ||
|
||
RUN sudo rm requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DOCKER_BASE_IMAGE="${DOCKER_BASE_IMAGE:-rayproject/ray:1.6.0-py39-gpu}" | ||
|
||
docker build --no-cache \ | ||
--build-arg DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE} \ | ||
-t ${DOCKER_BASE_IMAGE}-nmmo2023 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.