Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: No model config found in the file at C:\Users\gnanar\.deepface\weights\age_model_weights.h5. #20548

Open
Gnanapriya2000 opened this issue Nov 26, 2024 · 1 comment

Comments

@Gnanapriya2000
Copy link

I am trying to convert the age_model_weights.h5 to onnx .But it give me the following error

ValueError: No model config found in the file at C:\Users\gnanar.deepface\weights\age_model_weights.h5.

This is my code:

import tensorflow as tf
import tf2onnx
import onnx
from tensorflow.keras.models import load_model

Load the Keras model (.h5 file)

model = load_model("age_model_weights.h5")

Convert Keras model to ONNX format

onnx_model, _ = tf2onnx.convert.from_keras(model)
onnx.save(onnx_model, 'age_model.onnx')

print("Model successfully converted to ONNX format!")

@dhantule
Copy link
Contributor

Hi @Gnanapriya2000, thanks for reporting this. Could you provide some sample code to reproduce this issue? It's possible that you’re trying to load the model with age_model_weights.h5 where the model weights are being saved. You could try saving the model using model.save then loading and converting it to ONNX format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants