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.

"From PyTorch to PyTorch Lightning" outdated

See original GitHub issue

🐛 Bug

When using the example code from the documentation “From PyTorch to PyTorch Lightning”. In the newest version 0.7.1 you get the error AttributeError: 'LightningMNISTClassifier' object has no attribute 'mnist_val'.

To Reproduce

Steps to reproduce the behavior:

  1. Install version 0.7.1 from pytorch-ignite
  2. Copy Code at the bottom of the page from the doc “From PyTorch to PyTorch Lightning”
  3. Run it
  4. See error

Stacktrace

  File "D:\Programme\Anaconda3\envs\pytorch\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 630, in fit
    self.run_pretrain_routine(model)
  File "D:\Programme\Anaconda3\envs\pytorch\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 796, in run_pretrain_routine
    self.reset_val_dataloader(ref_model)
  File "D:\Programme\Anaconda3\envs\pytorch\lib\site-packages\pytorch_lightning\trainer\data_loading.py", line 154, in reset_val_dataloader
    self.val_dataloaders = self.request_data_loader(model.val_dataloader)
  File "D:\Programme\Anaconda3\envs\pytorch\lib\site-packages\pytorch_lightning\trainer\data_loading.py", line 220, in request_data_loader
    data_loader = data_loader_fx()
  File "C:/Users/schup/PycharmProjects/Workspace/pytorch_test/GAN/cnn_from_towardsdatascience.py", line 85, in val_dataloader
    mnist_val = DataLoader(self.mnist_val, batch_size=64)
  File "D:\Programme\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 576, in __getattr__
    type(self).__name__, name))
AttributeError: 'LightningMNISTClassifier' object has no attribute 'mnist_val'

Code sample

Code Article

Expected behavior

The example should provide a working MNIST classifier.

Environment

PyTorch version: 1.4.0 Is debug build: No CUDA used to build PyTorch: 10.1

OS: Microsoft Windows 10 Pro GCC version: Could not collect CMake version: Could not collect

Python version: 3.7 Is CUDA available: Yes CUDA runtime version: 10.2.89 GPU models and configuration: GPU 0: GeForce GTX 1050 Ti Nvidia driver version: 442.19 cuDNN version: Could not collect

Versions of relevant libraries: [pip3] numpy==1.16.1 [conda] blas 1.0 mkl [conda] mkl 2020.0 166 [conda] mkl-service 2.3.0 py37hb782905_0 [conda] mkl_fft 1.0.15 py37h14836fe_0 [conda] mkl_random 1.1.0 py37h675688f_0 [conda] pytorch 1.4.0 py3.7_cuda101_cudnn7_0 pytorch [conda] pytorch-ignite 0.4.0.dev20200229 pypi_0 pypi [conda] pytorch-lightning 0.7.1 pypi_0 pypi [conda] torchvision 0.4.1 pypi_0 pypi [conda] torchviz 0.0.1 pypi_0 pypi

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
williamFalconcommented, Mar 7, 2020

got it. will fix today!

0reactions
williamFalconcommented, Mar 8, 2020

fixed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"From PyTorch to PyTorch Lightning" outdated #1085 - GitHub
Bug When using the example code from the documentation "From PyTorch to PyTorch Lightning". In the newest version 0.7.1 you get the error ......
Read more >
Installation — PyTorch Lightning 1.8.5.post0 documentation
pip install pytorch-lightning has been deprecated and will stop being updated June 2023. Use pip install lightning instead.
Read more >
From PyTorch to PyTorch Lightning — A gentle introduction
This post answers the most frequent question about why you need Lightning if you're using PyTorch. PyTorch is extremely easy to use to...
Read more >
Conda is installing a very old version of pytorch-lightning
The problem was solved by launching a new conda environment. Apparently there were some conflicting pre installed dependencies.
Read more >
World Languages - Deep Learning with PyTorch Lightning
Build, train, deploy, and scale deep learning models quickly and accurately, improving your productivity using the lightweight PyTorch Wrapper.
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