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

Error loading history file (tf/keras 2.15) #20342

Open
Regenhardt opened this issue Oct 12, 2024 · 1 comment
Open

Error loading history file (tf/keras 2.15) #20342

Regenhardt opened this issue Oct 12, 2024 · 1 comment

Comments

@Regenhardt
Copy link

I trained some AI models (Conv->LSTM->Dense)on a linux server using the tensorflow:2.15 docker image. After training, I save the history like this:

history = model.fit(...)
with open(history_file, "wb") as f:  
    pickle.dump(history, f)

Then I download the files to my local windows computer and load them like this:

with open(history_file, "rb") as f:
    history = pickle.load(f)

Both use python 3.11. I already tried upgrading my local install, but it didn't work: tensorflow/tensorflow#74439

On pickle.load, I get the following error:

Error loading history file: 3c_128f_64f_32f_2l_100u_50u_without_implicit_adls_history Layer 'conv2d_3' expected 2 variables, but received 0 variables during loading. Expected: ['time_distributed_3/kernel:0', 'time_distributed_3/bias:0']

How do I fix this? I'd really like to load these histor files to add the data to my bachelor's thesis.

Other models worked, but there I only saved history.history, so that probably is part of the reason. I'd prefer not to have to retrain the models.

@mehtamansi29
Copy link
Collaborator

Hi @Regenhardt -

Thanks for reporting the issue. Can you provide the sample code of your model summary for helping in resolve the error ?

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

2 participants