question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watch() sometimes does not log the gradients

See original GitHub issue

Describe 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:

  1. Go to https://github.com/AliaksandrSiarohin/first-order-model
  2. 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')
  1. Run python run.py --config config/vox-256.yaml and we can see the generator and kp_detector gradients are logged.
  2. Run python run.py --config config/vox-adv-256.yaml, which is adversarial training, and we can see that only discriminator gradients are logged, not those of generator and kp_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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vanpeltcommented, Dec 13, 2021

It’s likely regular RAM that’s the issue.

1reaction
vanpeltcommented, Dec 9, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found