Hello! I am practicing huggingface by making a space using a CNN tensorflow model I made for image classification. I uploaded it to Hugging Face and called it in my spaces app.py with “from_pretrained_keras()”. However, I keep getting an error:
ValueError: File format not supported: filepath=/home/user/.cache/huggingface/hub/models–mayaseale–Monkey_Image_Classifier/snapshots/eebcd0fe508db0820231e15168960c4bfa4c425c. Keras 3 only supports V3 .keras
files and legacy H5 format files (.h5
extension). Note that the legacy SavedModel format is not supported by load_model()
in Keras 3. In order to reload a TensorFlow SavedModel as an inference-only layer in Keras 3, use keras.layers.TFSMLayer(/home/user/.cache/huggingface/hub/models--mayaseale--Monkey_Image_Classifier/snapshots/eebcd0fe508db0820231e15168960c4bfa4c425c, call_endpoint='serving_default')
(note that your call_endpoint
might have a different name).