google-research / scenic

Scenic: A Jax Library for Computer Vision Research and Beyond

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

playground.ipynb of OWL-ViT starts having dependency and import error on Google Colab since Nov. 15

XiangY-Q opened this issue · comments

I was able to run the playground demo as late as last Friday, although at the time, there was also dependency conflicts as I run first code block to install libraries (as shown below)

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.
lida 0.0.10 requires fastapi, which is not installed.
lida 0.0.10 requires kaleido, which is not installed.
lida 0.0.10 requires python-multipart, which is not installed.
lida 0.0.10 requires uvicorn, which is not installed.

Starting as early as this morning, the playground demo script would fail to import owl_vit models at this line
from scenic.projects.owl_vit import models
due to following error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-2-732db45ee9f0>](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <cell line: 10>()
      8 import numpy as np
      9 from scenic.projects.owl_vit import configs
---> 10 from scenic.projects.owl_vit import models
     11 
     12 from scenic.projects.owl_vit.notebooks import inference

14 frames
[/content/scenic/projects/owl_vit/models.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
      9 import jax.numpy as jnp
     10 import ml_collections
---> 11 from scenic.projects.owl_vit import layers
     12 from scenic.projects.owl_vit import matching_base_models
     13 from scenic.projects.owl_vit import utils

[/content/scenic/projects/owl_vit/layers.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     15 import numpy as np
     16 from scenic.model_lib.base_models import box_utils
---> 17 from scenic.projects.owl_vit import utils
     18 from scenic.projects.owl_vit.clip import layers as clip_layers
     19 from scenic.projects.owl_vit.clip import model as clip_model

[/content/scenic/projects/owl_vit/utils.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
      8 import jax.numpy as jnp
      9 import numpy as np
---> 10 from scenic.train_lib import train_utils
     11 import scipy
     12 

[/content/scenic/train_lib/train_utils.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     34 import ml_collections
     35 import numpy as np
---> 36 import optax
     37 from scenic.common_lib import debug_utils
     38 from scenic.dataset_lib import dataset_utils

[/usr/local/lib/python3.10/dist-packages/optax/__init__.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     15 """Optax: composable gradient processing and optimization, in JAX."""
     16 
---> 17 from optax import contrib
     18 from optax import losses
     19 from optax import monte_carlo

[/usr/local/lib/python3.10/dist-packages/optax/contrib/__init__.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     19 from optax.contrib.complex_valued import split_real_and_imaginary
     20 from optax.contrib.complex_valued import SplitRealAndImaginaryState
---> 21 from optax.contrib.mechanic import MechanicState
     22 from optax.contrib.mechanic import mechanize
     23 from optax.contrib.privacy import differentially_private_aggregate

[/usr/local/lib/python3.10/dist-packages/optax/contrib/mechanic.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     36 import jax.numpy as jnp
     37 from optax._src import base
---> 38 from optax._src import utils
     39 
     40 

[/usr/local/lib/python3.10/dist-packages/optax/_src/utils.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     20 import jax
     21 import jax.numpy as jnp
---> 22 import jax.scipy.stats.norm as multivariate_normal
     23 
     24 from optax._src import linear_algebra

[/usr/local/lib/python3.10/dist-packages/jax/scipy/stats/__init__.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     16 # See PEP 484 & https://github.com/google/jax/issues/7570
     17 
---> 18 from jax.scipy.stats import bernoulli as bernoulli
     19 from jax.scipy.stats import beta as beta
     20 from jax.scipy.stats import binom as binom

[/usr/local/lib/python3.10/dist-packages/jax/scipy/stats/bernoulli.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     16 # See PEP 484 & https://github.com/google/jax/issues/7570
     17 
---> 18 from jax._src.scipy.stats.bernoulli import (
     19   logpmf as logpmf,
     20   pmf as pmf,

[/usr/local/lib/python3.10/dist-packages/jax/_src/scipy/stats/bernoulli.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     14 
     15 
---> 16 import scipy.stats as osp_stats
     17 
     18 from jax import lax

[/usr/local/lib/python3.10/dist-packages/scipy/stats/__init__.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
    606 from ._warnings_errors import (ConstantInputWarning, NearConstantInputWarning,
    607                                DegenerateDataWarning, FitError)
--> 608 from ._stats_py import *
    609 from ._variation import variation
    610 from .distributions import *

[/usr/local/lib/python3.10/dist-packages/scipy/stats/_stats_py.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     35 from numpy import array, asarray, ma
     36 from numpy.lib import NumpyVersion
---> 37 from numpy.testing import suppress_warnings
     38 
     39 from scipy.spatial.distance import cdist

[/usr/local/lib/python3.10/dist-packages/numpy/testing/__init__.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
      9 
     10 from . import _private
---> 11 from ._private.utils import *
     12 from ._private.utils import (_assert_valid_refcount, _gen_alignment_data)
     13 from ._private import extbuild

[/usr/local/lib/python3.10/dist-packages/numpy/testing/_private/utils.py](https://x9qogj82r87-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20231114-060201_RC00_582258937#) in <module>
     55 IS_PYSTON = hasattr(sys, "pyston_version_info")
     56 HAS_REFCOUNT = getattr(sys, 'getrefcount', None) is not None and not IS_PYSTON
---> 57 HAS_LAPACK64 = numpy.linalg._umath_linalg._ilp64
     58 
     59 _OLD_PROMOTION = lambda: np._get_promotion_state() == 'legacy'

AttributeError: module 'numpy.linalg._umath_linalg' has no attribute '_ilp64'

It appears that the imported numpyhas version 1.23.5 (numpy.__version__ is 1.23.5), although the installed version shown by pip is 1.26.2 (shown by !python -m pip show numpy)

The running instance was T4GPU Python 3 Google Compute Engine backend (GPU)

Found that numpy 1.24.1 works.