When using the Kmeans function, there are times when the program just hangs. Cannot reproduce deterministically because it only happens sometimes. but the following code hangs sometimes and requires a restart of the kernel (running in jupyter notebook):
def get_cluster_labels(Z,k):
cluster_labels = []
for i in range(Z.shape[0]):
data = np.squeeze(Z[i,:,:]).reshape(Z.shape[1],Z.shape[2])
kmeans = Kmeans(data,k)
cluster_labels.append(kmeans.get_clusters())
return cluster_labels
When using the
Kmeansfunction, there are times when the program just hangs. Cannot reproduce deterministically because it only happens sometimes. but the following code hangs sometimes and requires a restart of the kernel (running in jupyter notebook):