I am trying to create a video classification model using MoViNet Classifiers (https://www.tensorflow.org/tutorials/video/transfer_learning_with_movinet),and i have tried saving this model using model.save, tf.saved_model.save etc. but at the time of loading this file it gives error
{ValueError: Unknown layer: MovinetClassifier. Please ensure this object is passed to the custom_objects
argument. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object for details.
}
I have also tried the methods present in the link in error still no leads, anybody have any idea on how to save this model & load it to perform predictions using MoViNet model on video data .
Expecting any way to create MoViNet Video classifiaction model, save & load it
Save your model using
model.save('path_to_my_model')
.Import the MovinetClassifier class in your script where you're loading the model. This is crucial because TensorFlow needs to recognize this custom class.
Load your model with the MovinetClassifier class specified in custom_objects. Use this code:
Make sure you have the same environment and dependencies as when you saved the model, especially the same TensorFlow version.