"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:
- Install version
0.7.1
frompytorch-ignite
- Copy Code at the bottom of the page from the doc “From PyTorch to PyTorch Lightning”
- Run it
- 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
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:
- Created 4 years ago
- Comments:5 (3 by maintainers)
got it. will fix today!
fixed!