Comments (4)
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_config4 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 aqtModuleNotFoundError: 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.
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:
Line 33 in 62a446f
(unfortunately
flaxformers
does not provide tags for the Github repo, nor a versioned pypi package).from vision_transformer.
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.
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)
- Fine-Tuning HOT 3
- ERROR: Could not find a version that satisfies the requirement tensorflow_text (from vit-jax) (from versions: none) ERROR: No matching distribution found for tensorflow_text HOT 1
- If the weights of vit-base trained with dropout available? HOT 1
- How do I download the vit_base_patch8_384.pth
- Package versions' confliction [Windows] HOT 2
- Question about commercial usage of LiT model checkpoints
- Shouldn't accumulate_gradient pass rng_key?
- GPU Requirement to use vision transformer HOT 1
- flax.errors.CallCompactUnboundModuleError
- ViT
- can export the pretrained model to onnx or pytorch? HOT 2
- Vision transformer
- Import error in Jax (colab) HOT 3
- fine-tune imagenet21k_ViT-B_16.npz with pre_logits? HOT 2
- KeyError: 'embedding/kernel is not a file in the archive' HOT 1
- Hyperparameter issues HOT 1
- All attempts to get a Google authentication bearer token failed, returning an empty token.
- Where is ViT-22B?
- Is it possible to provide the checkpoint?
- How can I use imagenet21k+imagenet2012/ViT-B_16.npz to inference
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vision_transformer.