I am trying to cluster the model parameters to separate benign and malicious ones into 2 clusters using kmeans. However, as it is a high dimensional data(approx 3 lakh parameters), I am getting an error which says:*ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (10, 1) + inhomogeneous part.
- . Can anyone please guide me here ....
local_dict.append(torch.stack([client_models[i].state_dict()[k]],0).cpu().detach().numpy())kmeans=KMeans(n_clusters=2,random_state=0).fit(local_dict)ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (10, 1) + inhomogeneous part.