faustomorales / vit-keras

Keras implementation of ViT (Vision Transformer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot load a saved model using "keras.models.load_model"

OpenNotebook opened this issue · comments

I am able to save a model after training in .h5 format using save() method without a problem, but facing problems while loading the model.

tensorflow == 2.4.1
(working on GCP)
**Error : **
raise ValueError('Unknown ' + printable_module_name + ': ' + class_name)
ValueError: Unknown layer: ClassToken

In order to diagnose, please provide code which reproduces the problem.

I fixed the problem by storing the models in the google storage bucket and loading them from the same. The problem was not related to your code. Thank you for your reply.