Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-style-guide-models-integrations-20260527-015516.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This page describes how to use W&B with OpenAI Gym to automatically capture videos of your reinforcement learning environments. You can then review agent behavior alongside your experiment metrics in W&B.
If you’re using OpenAI Gym, W&B automatically logs videos of your environment generated by
gym.wrappers.Monitor. To enable this, set the monitor_gym keyword argument to wandb.init() to True, or call wandb.gym.monitor().
The gym integration is lightweight. It looks at the name of the video file being logged from gym and names it after that, or falls back to "videos" if it doesn’t find a match. If you want more control, you can manually log a video.
The OpenRL Benchmark by CleanRL uses this integration for its OpenAI Gym examples. You can find source code (including the code used for specific runs) that demonstrates how to use gym with
