Skip to content

Exemplar dict is not serializable #13

Description

@trifle

Hi, thanks for your awesome libraries.

Just a short question: In this line:

representative_images[cluster] = {"Indices": [int(index) for index in exemplars],

you're casting the numpy int64s to integers, presumably so they can be used as indexes?
In any case, the cluster keys remain np.int64. This means the whole dict cannot be serialized (as json doesn't know how to handle numpy data types).

My suggestion would be to int() the keys as well to make this a bit less perplexing. But I'm not sure if you rely on the indexes being np.int64 in some other place?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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