Skip to content

Error converting MicroCluster to numpy array #3

Description

@asieriko

Hello,

MicroClusters are inhomogeneous structures (lists, integers, ...) so when converting them to numpy array it throws an error:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (100, 10) + inhomogeneous part.
(FedStream-main/fdstream.py", line 161, in convert_to_numpy)

In order to fix this the following has to be changed:
from:

np.asarray(MicroCluster)

to:

np.asarray(MicroCluster, dtype="object")

Maybe there is some change in the default behaviour in np.asarray

I've found 4 appearances in microcluster.py, and 4 in fdstream.py.

If you are interested I can send you a Pull request.

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