Pytorch-lightning: ImportError: cannot import name 'WandbLogger' from 'pytorch_lightning.loggers'

Created on 14 Apr 2020  ·  7Comments  ·  Source: PyTorchLightning/pytorch-lightning

🐛 Bug

I tried importing wandb logger from pytorch_lightning.loggers and got import error.

Code sample

from pytorch_lightning.loggers import WandbLogger

Environment

  • PyTorch Version (e.g., 1.0): 1.4.0
  • OS (e.g., Linux): Windows 10
  • How you installed PyTorch (conda, pip, source): pip
  • Python version: 3.7.7
  • CUDA/cuDNN version: Cuda compilation tools, release 10.1, V10.1.105
  • GPU models and configuration: 1050ti
Logger bug / fix help wanted

Most helpful comment

I had this same issue while using comet logger and wasn't sure what was wrong.

Actually I opened my code in vs code, and after that, I installed wandb and did the logging. It needed a restart to the editor to setup wandb properly with my editor command line, and after the restart, the error was gone indeed. I guess that's what happened with you as well.

The issue is solved. Thanks to everyone for the quick response.

All 7 comments

Hi! thanks for your contribution!, great first issue!

What is the exact error message? Which lightning version is installed?

from pytorch_lightning.loggers.wandb import WandbLogger also doesn't work?

You need to install wandb package first.
pip install wandb

You may also install all extra libs pip install -r requirements-extra.txt
@braindotai feel free to re-open if needed :rabbit:

Guess it would be helpful if there was a error displayed suggesting to install the logger package while importing. I had this same issue while using comet logger and wasn't sure what was wrong.

I had this same issue while using comet logger and wasn't sure what was wrong.

Actually I opened my code in vs code, and after that, I installed wandb and did the logging. It needed a restart to the editor to setup wandb properly with my editor command line, and after the restart, the error was gone indeed. I guess that's what happened with you as well.

The issue is solved. Thanks to everyone for the quick response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monney picture monney  ·  3Comments

remisphere picture remisphere  ·  3Comments

as754770178 picture as754770178  ·  3Comments

iakremnev picture iakremnev  ·  3Comments

williamFalcon picture williamFalcon  ·  3Comments