[Question] WandB logging with SubprocVecEnv
See original GitHub issueQuestion
Is it possible to perform logging using the WandB callback while using the SubprocVecEnv? I tried but I am encountering errors, so I’d like to know if you already tried this.
Additional context
If I create a run for each different environment in a subprocess (basically call wand.init
inside the env), I get the following error
AssertionError: daemonic processes are not allowed to have children
However, if I create one single run and perform the logging in the subprocesses, I get a different error (basically the PID of the process initializing the run and the PID of the processes performing the logs are different)
Checklist
- I have read the documentation (required)
- I have checked that there is no similar issue in the repo (required)
Issue Analytics
- State:
- Created a year ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Issues with gym video logging #1141 - GitHub
SubprocVecEnv is a common module from openai/baselines ... However, this causes issues for wandb video logging.
Read more >Stable Baselines 3 - Documentation - Weights & Biases - Wandb
Stable Baselines 3 · Record metrics such as losses and episodic returns · Upload videos of agents playing the games · Save the...
Read more >Stable-Baselines3 log rewards - python - Stack Overflow
You can access the local variables available to the logger callback using self.locals . Any variables exposed in your custom environment ...
Read more >Using Weights & Biases with Tune - the Ray documentation
log () to log your training process. Running A Weights & Biases Example. Tune Wandb API Reference. WandbLoggerCallback. Wandb-Mixin ...
Read more >Brief Introduction to Logging with Weights & Biases
wandb.log is a function that we use for logging. You can log almost everything you can ... Using W&B, you can easily diagnose...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think so, callback is in the main thread, not in the subprocesses. Closing as the issue is related to W&B, not SB3, and as the W&B works fine in the RL Zoo with multiple envs (and with subprocesses). See for instance https://wandb.ai/openrlbenchmark/sb3/runs/2tf89ihi?workspace=user-araffin
From what I understood from the WandB documentation, it is one of the 2 options for multiprocessing (call
init
in all your processes).So if I use
SubprocVecEnv
and create a subprocess for each env, I should callinit
in each subprocess, right?