mnist-tpu-training.ipynb tutorial has incorrect dependencies #130
Labels
bug / fix
Something isn't working
documentation
Improvements or additions to documentation
help wanted
Extra attention is needed
🐛 Bug
The MNIST training using TPU tutorial has incorrect dependencies. Running all cells from start to finish in Colab results in an error when trying to import pytorch lightning.
To Reproduce
Steps to reproduce the behavior:
Here is the output of the 3rd import cell.
Expected behavior
The 3rd cell and the remaining notebook complete without error.
Additional context
This occurs because torchtext is now version 0.11.0 by default in Colab, but XLA strictly requires torch and torchaudio, torchtext, torchvision have the same version as torch_xla.
The error can be fixed by changing the line
! pip install --quiet "pytorch-lightning>=1.3" "torchmetrics>=0.3" "torch>=1.6, <1.9" "torchvision"
To
! pip install --quiet "pytorch-lightning>=1.3" "torchmetrics>=0.3" "torch==1.8.0" "torchvision==0.9.0" "torchaudio==0.8.0" "torchtext==0.9.0"
(Then doing a factory reset of the runtime if you ran the previous bugged code)
This explicitly installs the correct versions of the torch libraries. I'm not certain about how to create a pull request for this myself. I converted my notebook using Jupytext and it seems adding the following lines
To the beginning of https://github.com/PyTorchLightning/lightning-tutorials/blob/main/lightning_examples/mnist-tpu-training/mnist-tpu.py should fix the issue. However I'm not sure why there isn't a "Setup" section there already, is there something about the CI system that I'm missing?
The text was updated successfully, but these errors were encountered: