fail to load h5 model

4,219 views
Skip to first unread message

Sylvain Ard

unread,
Jan 14, 2021, 6:12:34 AM1/14/21
to Keras-users

Hello everyone !
I have the error :
"
Traceback (most recent call last):
  File "/home/reveries/programmes/Valery_Malecot_opencv4/classification_simples_composees.py", line 16, in <module>
    model=load_model('feuilles_simples_composees.h5')
  File "/home/reveries/anaconda3/envs/transfer_learning2/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py", line 186, in load_model
    loader_impl.parse_saved_model(filepath)
  File "/home/reveries/anaconda3/envs/transfer_learning2/lib/python3.8/site-packages/tensorflow/python/saved_model/loader_impl.py", line 110, in parse_saved_model
    raise IOError("SavedModel file does not exist at: %s/{%s|%s}" %
OSError: SavedModel file does not exist at: feuilles_simples_composees.h5/{saved_model.pbtxt|saved_model.pb}
" when loading an h5 model file, the h5 file is existing.
thank you
Best regards

Sylvain Ard

unread,
Jan 14, 2021, 6:15:33 AM1/14/21
to Keras-users
apparently it try to load the model from a directory instead of a file

Sylvain Ard

unread,
Jan 14, 2021, 6:36:11 AM1/14/21
to Keras-users
I fix it, I was not in the good directory

Israq Ahmed Anik

unread,
Feb 10, 2021, 12:50:24 PM2/10/21
to Keras-users

Can I know how did you fix this , I am facing the same problem.

Israq Ahmed Anik

unread,
Feb 10, 2021, 1:16:46 PM2/10/21
to Keras-users
Never mind I solved it .

Md. Rafiuzzaman Bhuiyan Afridi

unread,
Feb 10, 2021, 1:35:06 PM2/10/21
to Israq Ahmed Anik, Keras-users
How you solve it?

--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/4644ee60-a3f4-474d-badd-aae7218cfbc4n%40googlegroups.com.

Israq Ahmed Anik

unread,
Feb 13, 2021, 4:00:39 PM2/13/21
to Md. Rafiuzzaman Bhuiyan Afridi, Keras-users
Install h5py , use pip if you are using vanilla python or conda for anaconda ..
Then,
Just save the model as saved_model.h5
And load it like this->
new_model = "./saved_model.h5"

Samiratu Ntohsi

unread,
Apr 16, 2021, 6:20:07 AM4/16/21
to Keras-users
Please how did you fix the issues. I need help

Chaitra Parameswarappa

unread,
Nov 29, 2022, 3:17:49 AM11/29/22
to Keras-users
oh my god.Thanks a ton. it worked.
god bless

Puan Abidah

unread,
Dec 11, 2023, 12:10:38 AM12/11/23
to Keras-users
Thank you so much!! It works on me
Reply all
Reply to author
Forward
0 new messages