Coder Social home page Coder Social logo

Comments (3)

faustomorales avatar faustomorales commented on July 17, 2024

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.

pranavchat14 avatar pranavchat14 commented on July 17, 2024

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.

faustomorales avatar faustomorales commented on July 17, 2024

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)

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.