wandb.watch(model): unwatch and rewatch models with new parameters, using Hugging Face
See original GitHub issuewandb --version && python --version && uname
wandb, version 0.9.3 Python 3.6.8 :: Anaconda, Inc. Darwin
Description
I was trying to unwatch models and rewatch them with new parameters. I am using the huggingface library which uses wandb.
What I Did
wandb.unwatch()
self._setup_wandb()
self._setup_wandb() is defined basically as:
wandb.watch(
self.model, log=os.getenv("WANDB_WATCH", "gradients"), log_freq=max(100, self.args.logging_steps)
)
Now, looking into unwatch/unhook in the wandb code:
def unhook_all(self):
for handle in self._hook_handles.values():
handle.remove()
self._hook_handles = []
def unhook(self, name):
handle = self._hook_handles.pop(name)
handle.remove()
This is wrong, it seems that at some point self._hook_handles was changed to a dictionary, so unhook/unhook all should be something like:
def unhook_all(self):
for handle in self._hook_handles.values():
handle.remove()
self._hook_handles = {}
def unhook(self, name):
handle = self._hook_handles[name]
handle.remove()
I havent tried this yet but I’ll get back to it if I do.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
wandb.watch(model): unwatch and rewatch models with new ...
I was trying to unwatch models and rewatch them with new parameters. I am using the huggingface library which uses wandb.
Read more >wandb.watch - Documentation - Weights & Biases
Hooks into the torch model to collect gradients and the topology. watch(. models,. criterion=None,. log: Optional[Literal['gradients', 'parameters', ...
Read more >Logging & Experiment tracking with W&B - Transformers
For people interested in tools for logging and comparing different models and training runs in general, Weights & Biases is directly ...
Read more >Simple index - piwheels
... command-line-blog bookery p01-dashboard proxycrawl markings mypy-boto3-servicecatalog-appregistry kilroy-module-huggingface sage-acsv devops-toolset fax ...
Read more >imdb.vocab - Department of Statistics and Data Science
the and a of to is it in i this that was as for with movie but film on not you ... too...
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 can confirm issues with
wandb.unwatch
method. Maybe we should wait for the new CLI?Hi Pedro, thanks for diving in to the
wandb.watch()
code, @borisdayma could you take a look?As for un-watching and re-watching a model, it sounds like you’re editing the model during training, is that right? I’d recommend calling wandb.init() to start a new run each time you want to watch a model with new parameters