Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## git clone https://github.com/xinpw8/pokegym.git -b BET_pokegym_badge_3_400m
## `git clone https://github.com/xinpw8/pokegym.git -b BET_pokegym_badge_3_400m`

## git clone https://github.com/xinpw8/PufferLib.git -b BET_pufferlib_0.7_badge_3_400m
## `git clone https://github.com/xinpw8/PufferLib.git -b BET_pufferlib_0.7_badge_3_400m`


# PokeGym Project Overview
Expand Down Expand Up @@ -30,52 +30,73 @@ Use Linux or WSL if you are on Windows. It does work on mac with some tweaks.

Installation
First, star PufferLib, Pokemon Red, and Pokegym on Github (hey, gotta promote, right?). Then:

```BASH
git clone -b 0.5 https://github.com/pufferai/pufferlib && cd pufferlib
pip install -e ".[cleanrl,pokemon_red]"
cp pokemon_red.gb pufferlib/
cp kanto_map_dsv.png pufferlib/
```

Run training. You will need to make a wandb account.
```BASH
python demo.py --train --vectorization multiprocessing --track --wandb-entity YOUR_WANDB_USERNAME
```

Watch a pretrained model play
```BASH
python demo.py --env pokemon_red_pip --evaluate PATH_TO_YOUR_MODEL
```

Play the game
pokegym.play

`pokegym.play`

You can use custom models with --evaluate PATH. They must be compatible (i.e. trained for this version of the env)


## To install (complete amateurs):
just installed today (WSL2 on Win10) using VS Code. The following is how I did it, provided for the aspiring dilettantes.

just installed today (WSL2 on Win10) using VS Code. The following is how I did it, provided for the aspiring dilettantes.

In VS Code I have the following pertinent Extensions installed locally: Dev Containers, Docker, and WSL.

To get started, I went to github and Starred PufferLib, PufferTank, and PokemonRedExperiments. Then, I followed the instructions at the following address first for getting the puffertank Docker container working: https://github.com/PufferAI/PufferTank. I already had Docker Desktop and the Nvidia Container Toolkit installed, so I started at step 2.
To get started, I went to github and Starred PufferLib, PufferTank, and PokemonRedExperiments.
Then, I followed the instructions at the following address first for getting the puffertank Docker container working: https://github.com/PufferAI/PufferTank.
I already had Docker Desktop and the Nvidia Container Toolkit installed, so I started at step 2.
In VS Code connected to WSL2:

```BASH
git clone https://github.com/PufferAI/PufferTank.git
```

Naturally, Docker Desktop was running (in Win10). After the Docker container successfully loaded and was running in Docker Desktop, in VS Code, using the Search bar, I navigated to the PufferTank directory and selected "Open folder in dev container." Then I installed the VS Code Docker extension (in the Dev Container container). I then navigated to /workspaces/ as root and proceeded to follow these commands:
Naturally, Docker Desktop was running (in Win10).
After the Docker container successfully loaded and was running in Docker Desktop, in VS Code, using the Search bar, I navigated to the PufferTank directory and selected "Open folder in dev container."
Then I installed the VS Code Docker extension (in the Dev Container container). I then navigated to /workspaces/ as root and proceeded to follow these commands:

```BASH
git clone -b pokemon_red https://github.com/pufferai/pufferlib && cd pufferlib
git checkout --track origin/pokemon_red
pip install -e '.[cleanrl,pokemon_red]'
cp pokemon_red.gb pufferlib/environments/
```

In retrospect I should have just followed the commands above instead of cloning the PufferTank repository first but it wasn't too much trouble (initially used the PufferTank config.py file, which had some conflicting packages; made sure to pip install -e '.[cleanrl,pokemon_red]' from /workspaces/pufferlib vs from /workspaces/PufferTank/puffertank/pufferlib). The final step cp pokemon_red.gb pufferlib/environments/ was done using a rom file outside of the PufferTank container. I then nagivated to cd ~ and installed FFmpeg:

In retrospect I should have just followed the commands above instead of cloning the PufferTank repository first but it wasn't too much trouble (initially used the PufferTank config.py file, which had some conflicting packages;
made sure to `pip install -e '.[cleanrl,pokemon_red]'` from `/workspaces/pufferlib` vs from `/workspaces/PufferTank/puffertank/pufferlib`).
The final step `cp pokemon_red.gb pufferlib/environments/` was done using a rom file outside of the PufferTank container. I then installed FFmpeg:
```BASH
apt install ffmpeg
```

That's it.

```BASH
cd /workspaces/pufferlib/
```

To run:
python demo.py --backend clean_pufferl --config pokemon_red --no-render --vectorization multiprocessing --mode train --track --wandb-entity xinpw8

```BASH
python demo.py --backend clean_pufferl --config pokemon_red --no-render --vectorization multiprocessing --mode train --track --wandb-entity xinpw8
```

## Configuration Summary

Expand Down