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.

[BUG] AutoGluon basic installation failing on Google Collab

See original GitHub issue
  • [ X] and/or I have checked that this bug exists on the latest mainline of AutoGluon via source installation

Steps to reproduce: Start collab notebook with GPU, then:

!pip3 install -U pip !pip3 install -U setuptools wheel !pip3 install autogluon

after installation, try to import TextPredictor: from autogluon.text import TextPredictor

the result is an ImportError:

`ImportError Traceback (most recent call last) <ipython-input-2-773ba8fa46a4> in <module>() ----> 1 from autogluon.text import TextPredictor

15 frames /usr/local/lib/python3.7/dist-packages/torchtext/data/datasets_utils.py in <module>() 10 ) 11 from torch.utils.data import functional_datapipe, IterDataPipe —> 12 from torch.utils.data.datapipes.utils.common import StreamWrapper 13 import codecs 14 try:

ImportError: cannot import name ‘StreamWrapper’ from ‘torch.utils.data.datapipes.utils.common’ (/usr/local/lib/python3.7/dist-packages/torch/utils/data/datapipes/utils/common.py)

---------------------------------------------------------------------------`

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yinweisucommented, May 4, 2022

Did some dig into this issue:

The fundamental issue is that a fresh colab gpu env has torch==1.11 and torchtext==0.12.0. The installation of autogluon only updates torch to 1.10.2 while torchtext remains to be 0.12.0 because torchtext is not part of our dependency. However, the fact that torchtext exists made pytorch_lightning, which is our dependency, to do a version check: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/utilities/imports.py#L120-L121. So _compare_version actually imports torchtext and torchtext==0.12.0 is not compatible with torch==1.10.2 because the import from torch.utils.data.datapipes.utils.common import StreamWrapper is not available.

1reaction
sxjsciencecommented, May 4, 2022

@rxjx @greenersharp I investigated again and feel that the root cause is pip3 install -U pip.

I tried the following and it will work without any issues. I guess we should not upgrade pip and just rely on the pip in Colab for doing installation:

!pip3 install autogluon.core
!pip3 install autogluon.features
!pip3 install autogluon.text

If that’s the case, this is not actually a bug but it’s due to inappropriate usage of Colab.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] AutoGluon basic installation failing on Google Collab
The fundamental issue is that a fresh colab gpu env has torch==1.11 and torchtext==0.12.0 . The installation of autogluon only updates torch to ......
Read more >
AutoGluon.ipynb - Colaboratory - Google Colab
This notebook purpose is to try out AutoGluon package open sourced by AWS. ... in your data: [' <=50K' ' >50K'] AutoGluon infers...
Read more >
How to fix this error for installing AutoGluon on Linux
I am trying to install AutoGluon on my university computer (Linux). I followed the instruction given here ...
Read more >
AutoML using AutoGluon - YouTube
AutoML # AutoGluOn #machinelearningIn this video we are going to review AutoGluon which is new kid in the block in AutoML suite.
Read more >
how to restart runtime in colab - You.com | The AI Search ...
It seems that everything except simple !pip install s seem to not get included in colab's module registry except after a runtime restart....
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