watch() sometimes does not log the gradients
See original GitHub issueDescribe the bug I am training a generative adversarial network. Without adversarial training, the gradients of the generator is logged. With adversarial training, the gradients of the generator is not logged.
To Reproduce Steps to reproduce the behavior:
- Go to https://github.com/AliaksandrSiarohin/first-order-model
- Add the following at line 71 of
run.py
wandb.watch(generator, log='all')
wandb.watch(discriminator, log='all')
wandb.watch(kp_detector, log='all')
- Run
python run.py --config config/vox-256.yamland we can see thegeneratorandkp_detectorgradients are logged. - Run
python run.py --config config/vox-adv-256.yaml, which is adversarial training, and we can see that onlydiscriminatorgradients are logged, not those ofgeneratorandkp_detector.
Expected behavior The gradients of all the three network should be logged for adversarial training.
Screenshots
Operating System
- OS: Linux
Additional context
conda list output: https://pastebin.com/sV920TQP
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:16 (6 by maintainers)
Top Results From Across the Web
watch() sometimes does not log the gradients #1639 - GitHub
Describe the bug I am training a generative adversarial network. Without adversarial training, the gradients of the generator is logged.
Read more >Wandb.watch with pytorch not logging anything - W&B Help
Wandb.watch not logging parameters; When is one supposed to run wandb.watch so that weights and biases tracks params and gradients?
Read more >Tensorflow GradientTape "Gradients does not exist for ...
Sometimes when I the error appears I can notice that the gradient function for that layer has not been called. My question is...
Read more >tf.GradientTape | TensorFlow v2.11.0
This allows multiple calls to the gradient() method as resources are ... tape.watch(a.variables) # Since `a.build` has not been called at ...
Read more >Logging metrics & gradients to W&B with PyTorch - YouTube
Your browser can't play this video. ... wandb. watch for logging gradients ... Logging metrics & gradients to W&B with PyTorch.
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 Free
Top 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

It’s likely regular RAM that’s the issue.
It’s likely getting killed due to memory preasure. We have to load the gradients from the GPU and if your model is really large your notebook may not have enough memory. Are you able to get a larger instance for your notebook?