Skip to content

Issue Loading Pretrained Weights for the Model in predict.py #1

Description

@dongleqing-pizi

Hi there,

I encountered some challenges while attempting to load the pretrained weights here for the Image Emotion Detection model.

Initially, I used the following code to load the model:
model = keras.models.load_model(filepath='model_weights.h5')
However, I received the following error:
image

Upon further investigation, I realized that the provided H5 file only contains the model weights, not the entire model structure. Consequently, I attempted to load only the weights using the following code:
model.load_weights('model_weights.h5')
Unfortunately, this resulted in another error:
image

It appears that the structure of the model in predict.py doesn't align with the provided pretrained weights. I would greatly appreciate your guidance on resolving this issue. If there are any additional steps or considerations that I may have overlooked, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions