1 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/saving/hdf5_format.py in load_model_from_hdf5(filepath, custom_objects, compile)
174 model_config = f.attrs.get(‘model_config’)
175 if model_config is None:
→ 176 raise ValueError(‘No model found in config file.’)
177 if hasattr(model_config, ‘decode’):
178 model_config = model_config.decode(‘utf-8’)
does it show the file there?
I’d also try copying the model to the colab folder (just for testing) and load it from there. This way you isolate the issue (is it Drive’s fault or not?)
I’ve just tried the model and I’m getting the same issue with the config.json
I don’t know how load that outside of the HF library. @markdaoust do you know if it can be done?
After hitting that error run a cell containing only %debug.
That will drop you into post mortem debugging and let you poke around and see what’s wrong. You’ll be on this line:
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 can repair the model.
okay soo from what u said i understand i don’t have a right h5 file? i am sorry if that wasn’t what u said but i don’t have any experince with h5 files or keras etc. My question is if I could load this model in the hugging face tensorflow version waht should i do right now to load this model in tensorflow
I think we’re making progress. The json is the model config, and maybe the h5 is just the weights.
for keras.models.model_from_json I think you need to read the json from the file before so something like model = keras.models.model_from_json(pathlib.Path(filename).read_text())
I think there is something wrong with the format that hugging face used . I will ask them about it on the form thank you for all your help I will get back to you after I find some more information from there cause I believe this isn’t a problem with tensorflow .
#* file_ID - it’s an identification of a file when you share it by the link, such as “1-CffbOeasBB6s5JkDFuD7zgGkli1aR_f”
#* path_to_your_model - path for your file, such as ./content/gdrive/MyDrive/TF/tf_model.h5 …also will try to a bit change this path in different variants