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

TypeError: '<' not supported between instances of 'dict' and 'float' in pickle.load(f) #123

Open
atifrizwan91 opened this issue Dec 7, 2023 · 0 comments

Comments

@atifrizwan91
Copy link

Environment Details:
Python Version: 3.7
TensorFlow Version: 2.9

Problem:
I am encountering a TypeError when attempting to unpickle a TensorFlow model that was previously saved using the pickle module. The model was pickled and is being unpickled in the same environment (Python 3.7, TensorFlow 2.9).

Code to Save the Model:

import pickle

with open('trained_height_map.pkl', 'wb') as f:
    pickle.dump(autoencoder, f)

Code to Load the Model:

with open('trained_height_map.pkl', 'rb') as f:
    autoencoder = pickle.load(f)

Error Encountered:

TypeError: '<' not supported between instances of 'dict' and 'float'

The error occurs specifically on the line where I try to load the model using pickle.load(f).

I would appreciate any insights or suggestions on how to resolve this error. Is there a known compatibility issue with TensorFlow models and pickle in this environment, or could there be something specific about the model that is causing this issue?

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

1 participant