ValueError: need at least one array to stack
yangyyt opened this issue · comments
/opt/conda/lib/python3.10/site-packages/sklearn/cluster/_kmeans.py:1416: FutureWarning: The default value of n_init
will change from 10 to 'auto' in 1.4. Set the value of n_init
explicitly to suppress the warning
super()._check_params_vs_input(X, default_n_init=10)
Traceback (most recent call last):
File "/vepfs/code/MossFormer/3D-Speaker/egs/3dspeaker/speaker-diarization/local/cluster_and_postprocess_h5.py", line 93, in audio_only_func_getnums
labels = cluster(embeddings)
File "/vepfs/code/MossFormer/3D-Speaker/speakerlab/process/cluster.py", line 186, in call
labels = self.filter_minor_cluster(labels, X, self.min_cluster_size)
File "/vepfs/code/MossFormer/3D-Speaker/speakerlab/process/cluster.py", line 203, in filter_minor_cluster
major_center = np.stack([x[labels == i].mean(0)
File "/opt/conda/lib/python3.10/site-packages/numpy/core/shape_base.py", line 445, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack
During handling of the above exception, another exception occurred:
===========================
运行这块时,labels = cluster(embeddings) # embedding [14, 192]
报了上边的错误;
请问是什么导致的问题,如何解决呢?
该错误已修复,可以更新speakerlab/process/cluster.py文件后重新运行