# When is one supposed to run wandb.watch so that weights and biases tracks params and gradients?

**URL:** <https://community.wandb.ai/t/when-is-one-supposed-to-run-wandb-watch-so-that-weights-and-biases-tracks-params-and-gradients/518>\
**Category:** W&B Help\
**Created:** [September 11, 2021, 5:29pm UTC](https://community.wandb.ai/t/when-is-one-supposed-to-run-wandb-watch-so-that-weights-and-biases-tracks-params-and-gradients/518 "2021-09-11T17:29:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![charlesfrye](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/charlesfrye/32/52_2.png) [@charlesfrye](https://community.wandb.ai/u/charlesfrye)\
**Post date:** [September 13, 2021, 5:20pm UTC](https://community.wandb.ai/t/when-is-one-supposed-to-run-wandb-watch-so-that-weights-and-biases-tracks-params-and-gradients/518/3 "2021-09-13T17:20:49Z")

</div>

There are two things you might be running into here – can’t confirm because your code relies on the `ultimate-utils` package.

1. `wandb.watch` will only start working once you call `wandb.log` _after_ a backwards pass that touches the watched `Module` ([docs](https://docs.wandb.ai/guides/integrations/pytorch#logging-gradients-with-wandb-watch)).
2. The frequency with which gradients/params are logged is controlled by the `log_freq` argument. If the number of logging calls is less than the value of `log_freq`, then no information will be logged. Here’s [a short colab](https://colab.research.google.com/drive/1ZnzV9NqOdMiBCKXGipkguqTn5UvN2aSg?usp=sharing) reproducing this behavior.

Also, if you want params and gradients, you need to set the `log` kwarg to `"all"`. By default, we log only gradients.

---

_[View the full topic](https://community.wandb.ai/t/when-is-one-supposed-to-run-wandb-watch-so-that-weights-and-biases-tracks-params-and-gradients/518)._
