Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import pytorch lightening module in colab #582

Closed
Dheeraj-Arremsetty opened this issue Mar 9, 2021 · 4 comments
Closed

Can't import pytorch lightening module in colab #582

Dheeraj-Arremsetty opened this issue Mar 9, 2021 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Dheeraj-Arremsetty
Copy link

Dheeraj-Arremsetty commented Mar 9, 2021

🐛 Bug

Hello Pytorch Team,
I have been working on pytorch lightning for several days, I have never seen this error on Google Colab.
Not sure if there is any change that happened on colab side or lightning.

When I install pytorch lightning and try to import pytorch lightening module, it can't import and throws out the error. The same was working till yesterday. Not sure If I am doing anything wrong on my side, here is the screenshot:
image

Same for bolts as well.
image

To Reproduce

Steps to reproduce the behavior:

!pip install pytorch-lightning --quiet
import pytorch_lightning as pl
!pip install pytorch-lightning-bolts --quiet
import pl_bolts as plb

Environment

  • PyTorch Version (e.g., 1.0):latest
  • OS (e.g., Linux):Colab
  • How you installed PyTorch (conda, pip, source): pip
  • Build command you used (if compiling from source):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

@Dheeraj-Arremsetty Dheeraj-Arremsetty added fix fixing issues... help wanted Extra attention is needed labels Mar 9, 2021
@kunal-savvy
Copy link

I am also getting same error. This is blocking our work. Any help?

@kunal-savvy
Copy link

ImportError                               Traceback (most recent call last)

<ipython-input-5-efd8697dde72> in <module>()
----> 1 import pytorch_lightning as pl

9 frames

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/apply_func.py in <module>()
     26 
     27 if _TORCHTEXT_AVAILABLE:
---> 28     from torchtext.data import Batch
     29 else:
     30     Batch = type(None)

ImportError: cannot import name 'Batch' from 'torchtext.data' (/usr/local/lib/python3.7/dist-packages/torchtext/data/__init__.py)


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.`
```

@ajsanjoaquin
Copy link

ajsanjoaquin commented Mar 10, 2021

Hello,

This is the same problem here. See the last post on the issue for a workaround.

@akihironitta
Copy link
Contributor

@Dheeraj-Arremsetty @kunal-savvy Hi, sorry for the delay. As @ajsanjoaquin mentioned, the problem should be resolved now. Mind having a look at Lightning-AI/pytorch-lightning#6415 or stackoverflow?

@Borda Borda added bug Something isn't working and removed fix fixing issues... labels Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants