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.

Logging results to Weights & Biases. Couldn't load entity due to error: Can't connect to network to query entity from API key

See original GitHub issue
  • Weights and Biases version: 0.8.15
  • Python version: 3.7.4
  • Operating System: Windows 10

Description

I updated the library and logged into wandb successfully through cli. I tried importing this snippet of code:

from wandb.keras import WandbCallback
wandb.init(project="my_project_name")

into my jupyter notebook and when I run all of my cells sequentially, I get this error:

AttributeError                            Traceback (most recent call last)
C:\Python37\lib\site-packages\wandb\meta.py in setup(self)
     46             import __main__
---> 47             self.data["program"] = __main__.__file__
     48         except (ImportError, AttributeError):

AttributeError: module '__main__' has no attribute '__file__'

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
 in 
      1 import wandb
      2 from wandb.keras import WandbCallback
----> 3 wandb.init(project="my_project_name")

C:\Python37\lib\site-packages\wandb\__init__.py in init(job_type, dir, config, project, entity, reinit, tags, group, allow_val_change, resume, force, tensorboard, sync_tensorboard, monitor_gym, name, notes, id, magic, anonymous)
   1068         allow_val_change = True
   1069     if config or telemetry_updated:
-> 1070         run.config._update(config, allow_val_change=allow_val_change, as_defaults=not allow_val_change)
   1071 
   1072     # Access history to ensure resumed is set when resuming

C:\Python37\lib\site-packages\wandb\wandb_config.py in _update(self, params, allow_val_change, as_defaults)
    276                 continue
    277             self._items[key] = val
--> 278         self.persist()
    279 
    280     def update(self, params, allow_val_change=False):

C:\Python37\lib\site-packages\wandb\wandb_config.py in persist(self)
    194             conf_file.write(str(self))
    195         if wandb.run and wandb.run._jupyter_agent:
--> 196             wandb.run._jupyter_agent.start()
    197 
    198     def get(self, *args):

C:\Python37\lib\site-packages\wandb\jupyter.py in start(self)
    120     def start(self):
    121         if self.paused:
--> 122             self.rm = RunManager(wandb.run, output=False, cloud=wandb.run.mode != "dryrun")
    123             wandb.run.api._file_stream_api = None
    124             self.rm.mirror_stdout_stderr()

C:\Python37\lib\site-packages\wandb\run_manager.py in __init__(self, run, project, tags, cloud, output, port)
    504         # Calling .start() on _meta and _system_stats will spin a thread that reports system stats every 30 seconds
    505         self._system_stats = stats.SystemStats(run, self._api)
--> 506         self._meta = meta.Meta(self._api, self._run.dir)
    507         self._meta.data["jobType"] = self._run.job_type
    508         self._meta.data["mode"] = self._run.mode

C:\Python37\lib\site-packages\wandb\meta.py in __init__(self, api, out_dir)
     34             self.data = {}
     35         self.lock = threading.Lock()
---> 36         self.setup()
     37         self._thread = threading.Thread(target=self._thread_body)
     38         self._thread.daemon = True

C:\Python37\lib\site-packages\wandb\meta.py in setup(self)
     52                     self.data["program"] = os.getenv(env.NOTEBOOK_NAME)
     53                 else:
---> 54                     meta = wandb.jupyter.notebook_metadata()
     55                     if meta.get("path"):
     56                         if "fileId=" in meta["path"]:

C:\Python37\lib\site-packages\wandb\jupyter.py in notebook_metadata()
    108             if isinstance(nn, dict) and nn.get("kernel"):
    109                 if nn['kernel']['id'] == kernel_id:
--> 110                     return {"root": s['notebook_dir'], "path": nn['notebook']['path'], "name": nn['notebook']['name']}
    111     return {}
    112 

KeyError: 'notebook'

What I Did

pip install --upgrade wandb
wandb login <insert token>


import wandb
from wandb.keras import WandbCallback
wandb.init(project="my_project_name")


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
ajay340commented, Jan 25, 2020

@jwanga Sorry about that. I had updated my wandb package but not jupyter. So I updated and restarted jupyter and now it is working.

3reactions
vanpeltcommented, Nov 17, 2019

@ajay340 set enitity to your username when you call wandb.init

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging results to Weights & Biases. Couldn't load entity due ...
Logging results to Weights & Biases. Couldn't load entity due to error: Can't connect to network to query entity from API key #678....
Read more >
Weights and Biases: Login and network errors - Stack Overflow
I installed wandb client on a new cloud server and tried to access my server from there.
Read more >
Import & Export Data - Documentation - Weights & Biases
Use the Public API to export or update data that you have saved to W&B. Before using this API, you'll want to log...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Improved Safari Web Extensions. Test out API improvements including the ability to open a Safari Web Extension popover programmatically. Web Inspector ...
Read more >
Default configuration - Documentation - Akka
conf files is for libraries, like Akka, to define default values that are used if an application doesn't define a more specific value....
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