faustomorales / vit-keras

Keras implementation of ViT (Vision Transformer)
Apache License 2.0
329 stars 78 forks source link

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

Closed OpenNotebook closed 3 years ago

OpenNotebook commented 3 years ago

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

faustomorales commented 3 years ago

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

OpenNotebook commented 3 years ago

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.