Git Product home page Git Product logo

Comments (4)

ZigeW avatar ZigeW commented on August 22, 2024 2

Thanks for the kind reply.

Unfortunately, I think the error is not transient. I also tried the colab on fresh Colab VMs for several times, but the error always exits:

ModuleNotFoundError Traceback (most recent call last)
in <cell line: 15>()
13 from vit_jax import input_pipeline
14 from vit_jax import utils
---> 15 from vit_jax import models
16 from vit_jax import train
17 from vit_jax.configs import common as common_config

4 frames
/content/./vision_transformer/vit_jax/models.py in
13 # limitations under the License.
14
---> 15 from vit_jax import models_lit
16 from vit_jax import models_mixer
17 from vit_jax import models_vit

/content/./vision_transformer/vit_jax/models_lit.py in
29 from vit_jax import preprocess
30
---> 31 from flaxformer.architectures.bert import bert
32 from flaxformer.architectures.bert import configs
33

/usr/local/lib/python3.10/dist-packages/flaxformer/architectures/bert/bert.py in
23
24 from flaxformer import transformer_common as common
---> 25 from flaxformer.architectures.bert import heads
26 from flaxformer.components import dense
27 from flaxformer.components import embedding

/usr/local/lib/python3.10/dist-packages/flaxformer/architectures/bert/heads.py in
22 import jax.numpy as jnp
23
---> 24 from flaxformer.components import dense
25 from flaxformer.components import initializers
26 from flaxformer.types import Activation

/usr/local/lib/python3.10/dist-packages/flaxformer/components/dense.py in
21 from typing import Any, Callable, Iterable, Mapping, Optional, Sequence, Tuple, Union
22
---> 23 from aqt.jax_legacy.jax import flax_layers as aqt_flax_layers
24 from aqt.jax_legacy.jax import quant_config as aqt_config
25 from aqt.jax_legacy.jax import quantization as aqt

ModuleNotFoundError: No module named 'aqt'

Since I'm using ViT models and the error seems to only appear when importing LiT models, I commented the lines about LiT in models.py (line 15, 28, 37 and 38) to bypass the error.

from vision_transformer.

andsteing avatar andsteing commented on August 22, 2024

I just tried
https://colab.research.google.com/github/google-research/vision_transformer/blob/main/vit_jax.ipynb
on a fresh Colab VM and !pip install -qr vision_transformer/vit_jax/requirements.txt completed without errors.

Maybe the error was transient?

You can specify a specific commit like flaxformer@git+https://github.com/google/flaxformer#5400cce007f3141c7f223a11846a2093b03a3588 (from their history) if you want to install an older version:

'flaxformer @ git+https://github.com/google/flaxformer',

(unfortunately flaxformers does not provide tags for the Github repo, nor a versioned pypi package).

from vision_transformer.

GrandmasterFred avatar GrandmasterFred commented on August 22, 2024

this error happens to me as well when using a copy of https://colab.research.google.com/github/google-research/vision_transformer/blob/main/vit_jax.ipynb @ZigeW 's solution bypasses the error, but removes the ability to use the LiT models I guess.

I tried out the specific commit fix in vision_transformer/vit_jax/setup.py by @andsteing and it does not work unfortunately, it throws the same error

install_requires = [
    'absl-py',
    'clu',
    'einops',
    'flax',
    'flaxformer @ git+https://github.com/google/flaxformer#5400cce007f3141c7f223a11846a2093b03a3588',
    'jax',
    'ml-collections',
    'numpy',
    'packaging',
    'pandas',
    'scipy',
    'tensorflow_datasets',
    'tensorflow_probability',
    'tensorflow',
    'tensorflow_text',
    'tqdm',
]

So I guess commenting out the lines are the way forward for now?

from vision_transformer.

andsteing avatar andsteing commented on August 22, 2024

Ok, the problem is actually in the latest release of the aqtp package: google/aqt#196

You can fix this by specifying !pip install aqtp==0.1.0 at the top of the Colab.

(PR fixing this repo is pending...)

from vision_transformer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.