wandb: [CLI]: initializing twice leads to `AttributeError: 'Run' object has no attribute '_telemetry_obj'.`
Describe the bug
Description
Starting from wandb==0.17.6, I noticed an issue that if I initialize twice as run = wandb.init(mode="disabled") I get AttributeError: 'Run' object has no attribute '_telemetry_obj'.
Ordinary mode, i.e., run = wandb.init() can be called many times.
Up until 0.17.5, run = wandb.init(mode="disabled") returned an instance of RunDisabled. This seems to have changed from 0.17.6.
Steps to reproduce the issue
import wandb
run = wandb.init(mode="disabled")
run = wandb.init(mode="disabled")
Traceback
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ryoto/conda/envs/materials/lib/python3.10/site-packages/wandb/sdk/wandb_init.py", line 1191, in init
wandb._sentry.reraise(e)
File "/home/ryoto/conda/envs/materials/lib/python3.10/site-packages/wandb/analytics/sentry.py", line 155, in reraise
raise exc.with_traceback(sys.exc_info()[2])
File "/home/ryoto/conda/envs/materials/lib/python3.10/site-packages/wandb/sdk/wandb_init.py", line 1176, in init
wi.setup(kwargs)
File "/home/ryoto/conda/envs/materials/lib/python3.10/site-packages/wandb/sdk/wandb_init.py", line 211, in setup
with telemetry.context(obj=self._init_telemetry_obj) as tel:
File "/home/ryoto/conda/envs/materials/lib/python3.10/site-packages/wandb/sdk/lib/telemetry.py", line 43, in __exit__
self._run._telemetry_callback(self._obj)
File "/home/ryoto/conda/envs/materials/lib/python3.10/site-packages/wandb/sdk/wandb_run.py", line 799, in _telemetry_callback
self._telemetry_obj.MergeFrom(telem_obj)
AttributeError: 'Run' object has no attribute '_telemetry_obj'. Did you mean: '_telemetry_flush'?
Additional Files
No response
Environment
WandB version: 0.17.6 OS: Ubuntu 22.04
Python version: 3.10
Versions of relevant libraries:
Additional Context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 9
- Comments: 28
Last working version is wandb==0.17.5 for wandb.init(mode=“disabled”)
Both wandb==0.17.6 and wandb==0.17.7 need tedious workarounds.
@kptkin With 0.17.8 the error message changes, but it is still broken. Please reopen.
I am also getting this with
wandb.init(mode='disabled')andwandb 0.17.7Me too, same error in 0.17.7.
0.17.7 is ok!
Still experiencing the same error with
WANDB_MODE=disabledand0.17.7.Jason Davenport commented: I wanted to update here an ensure everyone this has been fixed. Please let us know if you run into any more issues here. Thanks!
Same, upgrading to 0.17.7 did not fix it when using
wandb.init(mode='disabled'). Currently i have the following snipped in my tests to mock it out explicitly.test ok!
BTW: Is there any rational behind the weird API funneling everything through wand.init and having static global variables all over the place? Seems like a super smelly design decision 😄.