autogluon: [BUG] AutoGluon basic installation failing on Google Collab
- [ 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)
---------------------------------------------------------------------------`
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 23 (3 by maintainers)
Did some dig into this issue:
The fundamental issue is that a fresh colab gpu env has
torch==1.11
andtorchtext==0.12.0
. The installation ofautogluon
only updatestorch
to 1.10.2 whiletorchtext
remains to be 0.12.0 becausetorchtext
is not part of our dependency. However, the fact thattorchtext
exists madepytorch_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 importstorchtext
andtorchtext==0.12.0
is not compatible withtorch==1.10.2
because theimport from torch.utils.data.datapipes.utils.common import StreamWrapper
is not available.@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:
If that’s the case, this is not actually a bug but it’s due to inappropriate usage of Colab.