faustomorales / vit-keras

Keras implementation of ViT (Vision Transformer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NotFoundError when running example

alexblnn opened this issue · comments

Hello,

When trying to run your code:

pip install vit-keras

from vit_keras import vit, utils
image_size = 384
classes = utils.get_imagenet_classes()
model = vit.vit_b16(image_size=image_size,activation='sigmoid',pretrained=True,include_top=True,pretrained_top=True)

I get the following error: 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

This was ran on google colab with Tensorflow 2.4.0, Keras 2.4.3

According to tensorflow/addons#676 (comment) and tensorflow/addons#753 this is a known compatibility issue between TF and TF-addons. Upgrading TF-addons with pip install tensorflow_addons --upgrade solved the issue