pytorch-lightning: Cannot import pytorch-lightning-v0.5.3
Describe the bug
After updating to v0.5.3, import pytorch_lightning fails due to the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/pytorch_lightning/__init__.py", line 28, in <module>
from .trainer.trainer import Trainer
File "/usr/local/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 16, in <module>
from pytorch_lightning.trainer.callback_config_mixin import TrainerCallbackConfigMixin
File "/usr/local/lib/python3.7/site-packages/pytorch_lightning/trainer/callback_config_mixin.py", line 4, in <module>
from pytorch_lightning.logging import TestTubeLogger
ImportError: cannot import name 'TestTubeLogger' from 'pytorch_lightning.logging' (/usr/local/lib/python3.7/site-packages/pytorch_lightning/logging/__init__.py)
To Reproduce
Steps to reproduce the behavior:
$ docker run --rm -it python:3.7 /bin/bash
//
// Install `pytorch_lightning` (succeeded)
//
root@93bfd08b5db7:/# pip install pytorch_lightning
Collecting pytorch_lightning
Downloading https://files.pythonhosted.org/packages/2d/2e/ef5bedf1bb7f2f786d42f5af71ad5d7383416efec86098372d8016f5305d/pytorch-lightning-0.5.3.tar.gz (55kB)
...
Building wheels for collected packages: pytorch-lightning
Building wheel for pytorch-lightning (setup.py) ... done
Created wheel for pytorch-lightning: filename=pytorch_lightning-0.5.3-cp37-none-any.whl size=67557 sha256=80287a76e8fa15b4a64568fcd0c033688479f1bf7cb69dde8ba1d77da25453a6
Stored in directory: /root/.cache/pip/wheels/0f/4e/df/486c6c64d8d2f4706c70255493e434bacbf3497c7f5d0ab040
Successfully built pytorch-lightning
Installing collected packages: numpy, scipy, scikit-learn, tqdm, chardet, certifi, urllib3, idna, requests, docutils, webencodings, six, bleach, Pygments, readme-renderer, pkginfo, requests-toolbelt, twine, torch, pillow, torchvision, pytz, python-dateutil, pandas, pytorch-lightning
Successfully installed Pygments-2.4.2 bleach-3.1.0 certifi-2019.9.11 chardet-3.0.4 docutils-0.15.2 idna-2.8 numpy-1.16.4 pandas-0.25.3 pillow-6.2.1 pkginfo-1.5.0.1 python-dateutil-2.8.1 pytorch-lightning-0.5.3 pytz-2019.3 readme-renderer-24.0 requests-2.22.0 requests-toolbelt-0.9.1 scikit-learn-0.20.2 scipy-1.3.1 six-1.13.0 torch-1.3.0 torchvision-0.4.1 tqdm-4.35.0 twine-1.13.0 urllib3-1.25.6 webencodings-0.5.1
//
// Import `pytorch_lightning` (failed)
//
root@93bfd08b5db7:/# python
Python 3.7.5 (default, Oct 19 2019, 00:03:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytorch_lightning
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/pytorch_lightning/__init__.py", line 28, in <module>
from .trainer.trainer import Trainer
File "/usr/local/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 16, in <module>
from pytorch_lightning.trainer.callback_config_mixin import TrainerCallbackConfigMixin
File "/usr/local/lib/python3.7/site-packages/pytorch_lightning/trainer/callback_config_mixin.py", line 4, in <module>
from pytorch_lightning.logging import TestTubeLogger
ImportError: cannot import name 'TestTubeLogger' from 'pytorch_lightning.logging' (/usr/local/lib/python3.7/site-packages/pytorch_lightning/logging/__init__.py)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (11 by maintainers)
I had the same error, too
cannot import name 'TestTubeLogger'I triedpip install test-tubeand it saysbut after that, I had exactly the same error again, How can I do?
I had the same error, too cannot import name ‘TestTubeLogger’
I have installed test-tube. how to solve it? Thanks
@sile you need to install
test-tubefrom pypi@Borda My problem was solved by installing
test-tube. Thank you!BTW, I think that it’s better to add
test-tubeto requirements.txt if the package is mandatory to importpytorch_lightning.