faustomorales / vit-keras

Keras implementation of ViT (Vision Transformer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

load fine-tuned model with keras.load_model

HurongCSU opened this issue · comments

I finetuned the vit_b16 model with new data and saved the new model by "save".
When I load this retrained model, ending up with "TypeError: call () missing 1 required positional argument: 'training' " .
Any suggestions? Thanks!

@HurongCSU can you show your file with the steps that you're taking to do Fine-Tuning?

The same issue here~
I ran the first demo code mentioned in the Usage part, but it shows the same error above.

Is there anything I can do~? Thanks!

I encountered this error and found out what is causing it.
I think it happened in TransformerBlock class in vit_keras/layers.py.

def call(self, inputs, training):

I manually changed the source code and fixed the error.

@Mten7271 how did you change it?