Hypothesis: An agent trained with Intrinsic Curiosity (ICM) on Maze transfers better to Heist than a vanilla PPO agent.
icm_project/
├── train.py # PPO + optional ICM training on Maze
├── transfer.py # Zero-shot and finetune evaluation on Heist
├── models/
│ ├── __init__.py
│ └── icm.py # Intrinsic Curiosity Module (Pathak et al. 2017)
├── requirements.txt
└── README.md
Python 3.8 is required. Procgen does not support 3.9+ cleanly.
# 1. Create a clean environment
conda create -n icm python=3.8 -y
conda activate icm
# 2. Install dependencies
pip install -r requirements.txt
# 3. Verify Procgen works
python -c "import procgen; print('procgen ok')"python train.py --env_id mazeCheckpoint saved to: checkpoints/maze__vanilla__1__TIMESTAMP/final.pt
python train.py --env_id maze --use_icmCheckpoint saved to: checkpoints/maze__icm__1__TIMESTAMP/final.pt
Run both checkpoints through Heist with no training:
# Vanilla baseline
python transfer.py \
--checkpoint checkpoints/maze__vanilla__1__TIMESTAMP/final.pt \
--mode zero_shot
# ICM agent
python transfer.py \
--checkpoint checkpoints/maze__icm__1__TIMESTAMP/final.pt \
--mode zero_shotCompare the mean rewards. The ICM agent should score higher.
Tests George's suggestion: freeze backbone, train only last N layers on Heist.
# Finetune actor + critic heads only (n=1)
python transfer.py \
--checkpoint checkpoints/maze__icm__1__TIMESTAMP/final.pt \
--mode finetune --n_layers 1
# Finetune heads + final linear layer (n=2)
python transfer.py \
--checkpoint checkpoints/maze__icm__1__TIMESTAMP/final.pt \
--mode finetune --n_layers 2python train.py --env_id maze --use_icm --cuda --track --wandb_project_name icm-transferpython train.py --env_id maze --cuda --track --wandb_project_name without_icm-transfertensorboard --logdir runs/| Run | Command | Purpose |
|---|---|---|
| Model 1 | train.py --env_id maze |
Vanilla PPO baseline |
| Model 2 | train.py --env_id maze --use_icm |
Curiosity agent |
| Transfer A | transfer.py --mode zero_shot (Model 1 ckpt) |
Baseline transfer |
| Transfer B | transfer.py --mode zero_shot (Model 2 ckpt) |
Curiosity transfer |
| Ablation 1 | transfer.py --mode finetune --n_layers 1 |
N-layer test |
| Ablation 2 | transfer.py --mode finetune --n_layers 2 |
N-layer test |
- Mean reward on Heist (zero-shot) — primary result
- Learning curve on Heist (finetune) — sample efficiency
- Intrinsic reward over time (logged to tensorboard) — did ICM actually explore?
- ICM forward loss — is the model learning the dynamics?
ModuleNotFoundError: procgen
→ Make sure you're in the icm conda env: conda activate icm
gym.error.UnregisteredEnv
→ You need gym==0.21.0 not gymnasium. Check pip show gym.
CUDA out of memory
→ Reduce --num_envs 32 or run without --cuda
assert x.shape[1:] == self.get_output_shape()
→ The ConvSequence shape check failed. This means obs shape changed.
Procgen should always be 64x64x3 — check your wrapper.