Comments (3)
Yes, the intention is for this package to work with the latest available version of TensorFlow. Could you provide the following?
- The version of TensorFlow that didn't work
- The error (along with a full traceback)
The dependencies for this package are specified using pyproject.toml, which would make a requirements.txt
superfluous. TensorFlow is not specified there in order to allow people to install their preferred flavor of the package (e.g., some people still use tensorflow-gpu
or build from source).
from vit-keras.
I am using Google Colab. I am doing exactly like instructed in README.md.
I have installed vit-keras using pip. Then I go with this example code:
image_size = 224
model = vit.vit_l32(
image_size=image_size,
activation='sigmoid',
pretrained=True,
include_top=True,
pretrained_top=False,
classes=200
)
The details are as follows:
-
The version of TensorFlow that didn't work: tensorflow==2.4.1
-
The error message: Below
NotFoundError Traceback (most recent call last)
in ()
8 include_top=True,
9 pretrained_top=False,
---> 10 classes=200
11 )
14 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename)
55 RuntimeError: when unable to load the library or get the python wrappers.
56 """
---> 57 lib_handle = py_tf.TF_LoadLibrary(library_filename)
58 try:
59 wrappers = _pywrap_python_op_gen.GetPythonWrappers(
NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow_addons/custom_ops/activations/_activation_ops.so: undefined symbol: _ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefEN4absl11string_viewESt10unique_ptrINS0_15OpKernelFactoryESt14default_deleteIS8_EE
from vit-keras.
Ah, you've run into a compatibility problem between tensorflow_addons
and tensorflow
. Unfortunately, users have to manage the version compatibility for these two packages manually. See the tensorflow_addons
README for more information on why that's the case. Unfortunately, it's not something that vit-keras
can handle automatically.
Because Google Colab periodically updates the version of TensorFlow that ships, it's also not easy to just set a version of tensorflow_addons
to fix it. For that reason, I suggest setting a fixed version for both tensorflow
and tensorflow_addons
at the top of your notebook.
As an example, if you want to use tensorflow==2.4.1
, you can look it up on the tensorflow_addons
compatibility chart and see that it requires tensorflow_addons==0.12.1
. And so the following would work in a Google Colab notebook.
!pip install -q vit-keras tensorflow==2.4.1 tensorflow_addons==0.12.1
import vit_keras.vit as vit
image_size = 224
model = vit.vit_l32(
image_size=image_size,
activation='sigmoid',
pretrained=True,
include_top=True,
pretrained_top=False,
classes=200
)
Closing this for now but let me know if this doesn't solve your problem.
from vit-keras.
Related Issues (20)
- how to get the official pretrain model with npz format? HOT 1
- The [call] method in TransformerBlock has different input args HOT 1
- grayscale images HOT 1
- Multilabel: class-wise attention maps HOT 2
- image size HOT 1
- weights file failed to load ("File is not a zip file") HOT 2
- load_pretrained - BASE_URL 404 Not Found HOT 3
- different image size in fine-tuning HOT 3
- Different number of channels HOT 3
- error with visualization HOT 1
- Visualization of transfer learning model
- can you public a url to download the offcial weights? HOT 1
- load fine-tuned model with keras.load_model HOT 4
- Interest in implementing pre-trained weights from "ImageNet-21K Pretraining for the Masses" to vit-keras HOT 1
- Meaning of FlexErf node
- No requirements file makes compatibility issues challenging to debug. HOT 1
- Minimum image size to use pretrained weights HOT 1
- Finetuning
- Error importing the model HOT 1
- ModuleNotFoundError: No module named 'keras.src.engine' HOT 1
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 vit-keras.