Farama-Foundation / MicroRTS-Py

A simple and highly efficient RTS-game-inspired environment for reinforcement learning (formerly Gym-MicroRTS)
MIT License
226 stars 44 forks source link

Memory leak issue that @xluox has #86

Open vwxyzjn opened 1 year ago

vwxyzjn commented 1 year ago

@xluox

How to reproduce


git clone https://github.com/xluox/gym-microrts.git --recurse-submodules
cd gym-microrts
git checkout PCG
git pull --recurse-submodules
poetry install
poetry run pip install torch==1.12.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
bash build.sh &> build.log
mv evaluation_maps gym_microrts/microrts/maps/evaluation_maps
cd experiments
poetry run python ppo_gridnet.py --max-eval-workers 0
# optionally `xvfb-run -a poetry run python ppo_gridnet.py` if in a headless server.
xluox commented 1 year ago

Some update to the commands

git clone https://github.com/xluox/gym-microrts.git --recurse-submodules
cd gym-microrts
git checkout PCG
git pull --recurse-submodules
poetry install
bash build.sh &> build.log
rm -rf gym_microrts/microrts/maps/evaluation_maps
cp -R evaluation_maps gym_microrts/microrts/maps/evaluation_maps
# Train with 1 map:
cd experiments
poetry run python ppo_gridnet.py --pcg-mode False --prod-mode --eval-maps maps/evaluation_maps/league_16x16_eval_1.xml maps/evaluation_maps/league_16x16_eval_2.xml maps/evaluation_maps/league_16x16_eval_3.xml maps/evaluation_maps/league_16x16_eval_4.xml maps/evaluation_maps/league_16x16_eval_5.xml --max-eval-workers 4 

# Train with PCG map set with no outer walls:
rm -rf PCG/maps
cp -R PCG/maps_no_walls PCG/maps 
cd experiments
poetry run python ppo_gridnet.py --pcg-mode True --prod-mode --eval-maps maps/evaluation_maps/league_16x16_eval_1.xml maps/evaluation_maps/league_16x16_eval_2.xml maps/evaluation_maps/league_16x16_eval_3.xml maps/evaluation_maps/league_16x16_eval_4.xml maps/evaluation_maps/league_16x16_eval_5.xml --max-eval-workers 4

# Train with PCG map set with outer walls:
rm -rf PCG/maps 
cp -R PCG/maps_walls PCG/maps 
cd experiments
poetry run python ppo_gridnet.py --pcg-mode True --prod-mode --eval-maps maps/evaluation_maps/league_16x16_eval_1.xml maps/evaluation_maps/league_16x16_eval_2.xml maps/evaluation_maps/league_16x16_eval_3.xml maps/evaluation_maps/league_16x16_eval_4.xml maps/evaluation_maps/league_16x16_eval_5.xml --max-eval-workers 4

# optionally `xvfb-run -a poetry run python ppo_gridnet.py` if in a headless server.
# When finish, discard all changes and run:
rm -r gym_microrts/microrts/maps/evaluation_maps