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

PCLR SavedModel different to PCLR.h5, unable to load PCLR.h5 #484

Open
raymond53892 opened this issue Mar 17, 2022 · 2 comments
Open

PCLR SavedModel different to PCLR.h5, unable to load PCLR.h5 #484

raymond53892 opened this issue Mar 17, 2022 · 2 comments

Comments

@raymond53892
Copy link

What
PCLR SavedModel different to PCLR.h5 and model as described in the pre-print Appendix A
Unable to load PCLR.h5 - SavedModel file does not exist at: ./PCLR.h5/{saved_model.pbtxt|saved_model.pb}

Why
The PCLR models are different between the newer Keras saved model format and the older H5 format (older format has 2 additional Dense layers)

How
Please provide the older H5 model in the newer saved model format so it can be loaded
Alternatively, specify the versions of tensorflow, Keras and python used to save the .h5 model, so the same environment can be used to load the model

@divyashan
Copy link

divyashan commented May 26, 2023

Hello - chiming in to say that I'm interested code to load the saved models, too. From what I can tell, the syntax to load "saved_model.pb" files accepts a directory, while loading the h5 file requires the file name.

Along those lines, I've tried both load_model('./PCLR.h5') and load_model('./PCLR_lead_I').

for both, I receive the error: "Read less bytes than requested". I think this might have to do with git LFS and the fact that I git cloned the repo, but I'm not sure.

Any tips would be much appreciated!

@divyashan
Copy link

This sequence helped me load the model:

brew install git-lfs 
git lfs install
git lfs migrate import --everything

and after this, I was able to load the model with

from tensorflow.keras.models import load_model
model = load_model('PCLR.h5', compile=False)

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

No branches or pull requests

2 participants