question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load model from .h5 file

See original GitHub issue
# Unable to load model
Using TensorFlow backend.
Traceback (most recent call last):
  File "ocv.py", line 7, in <module>
    model = load_model('bottleneck_fc_model.h5')
  File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 230, in load_model
    raise ValueError('No model found in config file.')
ValueError: No model found in config file.

I did not find a clear answer in other issues.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

67reactions
Dref360commented, Jun 11, 2017

Did you saved with model.save or model.save_weights? Also, try to provide a working example so that we can see if it’s a bug.

26reactions
sureddi-rajeshcommented, Jul 14, 2017

I am using a pre-trained model such as Alexnet, In this case also, ending up with the same error.

I was downloaded the alexnet_weights from here–>https://github.com/heuritech/convnets-keras then I tried like this

from keras.models import load_model base_model=load_model(‘alexnet_weights.h5’)

I ended up with

ValueError: No model found in config file.

please help me to get rid out of it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't load my trained h5 model with load.models(), how do I ...
Yes, there is a conflict between tf.keras and keras packages, you trained the model using tf.keras but then you are loading it with...
Read more >
Problems loading h5 model - TensorFlow Forum
This failed: model_config = f.attrs.get('model_config') (returned None). So inspect that f.attrs and try to figure out what's wrong, maybe you ...
Read more >
Unable to load a .h5 keras model
but when I'm trying to load the model using the following command: saved_model = keras.models.load_model('mymodel.h5').
Read more >
fail to load h5 model - Google Groups
Hello everyone ! I have the error : " Traceback (most recent call last): File "/home/reveries/programmes/Valery_Malecot_opencv4/ ...
Read more >
How to Save and Load Your Keras Deep Learning Model
It is important to compile the loaded model before it is used. ... I have created the keras model file (.h5) unfortunately it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found