krasserm/perceiver-io

AttributeError: module 'numpy' has no attribute '_no_nep50_warning'

0scarJ1ang opened this issue · 7 comments

After I install perceiver io by the given code: !pip install perceiver-io[text,vision]
I tried to import by:from perceiver.model.core import PerceiverIOConfig
But get the following error:

AttributeError Traceback (most recent call last)
in
----> 1 from perceiver.model.core import PerceiverIOConfig
2 from perceiver.model.text.mlm import MaskedLanguageModel, TextEncoderConfig, TextDecoderConfig
3
4 vocab_size = 262 # E
5 max_seq_len = 2048 # M, O

46 frames
/usr/local/lib/python3.8/dist-packages/numpy/init.py in getattr(attr)
311 # The previous way Tester was imported also had a side effect of adding
312 # the full numpy.testing namespace
--> 313 if attr == 'testing':
314 import numpy.testing as testing
315 return testing

AttributeError: module 'numpy' has no attribute '_no_nep50_warning'

In which environment did you pip install perceiver-io[text,vision] (conda, venv, ...)? How was the environment set up?

In which environment did you pip install perceiver-io[text,vision] (conda, venv, ...)? How was the environment set up?

I use google colab directly. :)

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchtext 0.14.1 requires torch==1.13.1, but you have torch 1.12.1 which is incompatible.
torchaudio 0.13.1+cu116 requires torch==1.13.1, but you have torch 1.12.1 which is incompatible.
scipy 1.7.3 requires numpy<1.23.0,>=1.16.5, but you have numpy 1.24.2 which is incompatible.
numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.2 which is incompatible.
Successfully installed aiobotocore-2.4.2 aioitertools-0.11.0 botocore-1.27.59 datasets-2.9.0 docstring-parser-0.15 einops-0.4.1 fairscale-0.4.13 huggingface-hub-0.12.1 jmespath-1.0.1 jsonargparse-4.19.0 lightning-utilities-0.6.0.post0 multiprocess-0.70.14 numpy-1.24.2 perceiver-io-0.7.0 pytorch-lightning-1.9.2 pytorch-ranger-0.1.1 responses-0.18.0 s3fs-2023.1.0 tokenizers-0.12.1 torch-1.12.1 torch-optimizer-0.3.0 torchmetrics-0.9.3 torchvision-0.13.1 transformers-4.26.1 typeshed-client-2.2.0 urllib3-1.26.14 xxhash-3.2.0

This error occurs during the instalment, I wonder if that matters.

I can reproduce it, will take a look soon. Thanks for reporting! In the meantime you can try running it locally following https://github.com/krasserm/perceiver-io#from-sources

Thanks a lot! Is the from-sources installation the more recommended way? (sorry if I ask stupid questions, as I just started learning this field)

With pip (on Colab) should work fine actually, but seems there have been upgrades to Colab recently which are incompatible with the latest release. An installation from sources with conda + poetry will work for sure.

@0scarJ1ang the notebook is working now and has been upgraded to the latest release.