Hi folks,
I’ve been working on setting up a simple test script for integrating wandb and I’ve run into an issue with wandb’s monitor_gym setting. If this is set to True then gym’s Monitor wrapper is modified so any videos that are created will automatically be uploaded to wandb. My theory is that this has something to do with each rllib worker loading its own libraries. I’m not yet sure what the best approach is to fix this, but it would be nice if this could automatically be taken care of when the WandbLoggerCallback is used.
Here’s my test script if you want to quickly reproduce this:
tune.run(
"PPO",
config={
"env": "CartPole-v0",
"num_workers": 1,
"num_envs_per_worker": 1,
"record_env": "videos"
},
callbacks=[
WandbLoggerCallback(
project="project_name",
api_key_file="api_key.txt"
monitor_gym=True # calls wandb.gym.monitor() -> gym's Monitor wrapper is modified to automatically log videos
)
],
stop={
"training_iteration": 1
}
)