I am getting some errors when running wandb on google colab.
- wandb.login() not working
It will run for a while, and then the screen will change to a white Google Chrome error screen, showing error code 5.
If I refresh Chrome and go back to colab, wandb.login is still running and if you force it to stop, you will see an error message like below.
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-2-f4bc2b362420> in <cell line: 1>()
----> 1 wandb.login()
7 frames
/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_login.py in login(anonymous, key, relogin, host, force, timeout)
75 return True
76 kwargs = dict(locals())
---> 77 configured = _login(**kwargs)
78 return True if configured else False
79
/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_login.py in _login(anonymous, key, relogin, host, force, timeout, _backend, _silent, _disable_warning, _entity)
296
297 if not key:
--> 298 wlogin.prompt_api_key()
299
300 # make sure login credentials get to the backend
/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_login.py in prompt_api_key(self)
219
220 def prompt_api_key(self):
--> 221 key, status = self._prompt_api_key()
222 if status == ApiKeyStatus.NOTTY:
223 directive = (
/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_login.py in _prompt_api_key(self)
199 while True:
200 try:
--> 201 key = apikey.prompt_api_key(
202 self._settings,
203 api=api,
/usr/local/lib/python3.10/dist-packages/wandb/sdk/lib/apikey.py in prompt_api_key(settings, api, input_callback, browser_callback, no_offline, no_create, local)
88 if jupyter and "google.colab" in sys.modules:
89 log_string = term.LOG_STRING_NOCOLOR
---> 90 key = wandb.jupyter.attempt_colab_login(app_url)
91 if key is not None:
92 write_key(settings, key, api=api)
/usr/local/lib/python3.10/dist-packages/wandb/jupyter.py in attempt_colab_login(app_url)
321 )
322 try:
--> 323 return output.eval_js("_wandbApiKey")
324 except MessageError:
325 return None
/usr/local/lib/python3.10/dist-packages/google/colab/output/_js.py in eval_js(script, ignore_result, timeout_sec)
38 if ignore_result:
39 return
---> 40 return _message.read_reply_from_input(request_id, timeout_sec)
41
42
/usr/local/lib/python3.10/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
94 reply = _read_next_input_message()
95 if reply == _NOT_READY or not isinstance(reply, dict):
---> 96 time.sleep(0.025)
97 continue
98 if (
KeyboardInterrupt:
The commands below sometimes work to log in.
! wandb login
Sometimes wandb.init() doesn’t work well even if the login is successful. When i run wandb.init() or run the next cell after init, colab runtime will be disconnected and reconnected after a small wait. After that, logging is sometimes fine. However, this disconnection is very disruptive for iterative experiments.