Skip to content

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

@atifrizwan91

Description

@atifrizwan91

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions