pytorch-metric-learning
                                
                                 pytorch-metric-learning copied to clipboard
                                
                                    pytorch-metric-learning copied to clipboard
                            
                            
                            
                        Using pytorch-metric-learning and fit_transform() in umap togather cause segementation fault
demo code here, test device: macos m2 chip
import numpy as np
from pytorch_metric_learning.utils.accuracy_calculator import AccuracyCalculator
import umap
    
if __name__ == '__main__':
    umapper = umap.UMAP()
    test_embeddings = np.random.normal(size=(100, 64))
    umap_embeddings = umapper.fit_transform(test_embeddings)
env: pytorch-metric-learning == 2.1.0 umap-learn == 0.5.3
This sounds like an issue for UMAP, not pytorch-metric-learning. Here are some issues from the umap github repo that might help: https://github.com/lmcinnes/umap/search?q=segmentation+fault&type=issues
Do you mean your code works if you remove the AccuracyCalculator import?
Do you mean your code works if you remove the AccuracyCalculator import?
yes. In my env, pml can't work with umap.
Wow, strange. I'll reopen the issue.
import numpy as np from pytorch_metric_learning.utils.accuracy_calculator import AccuracyCalculator import umap if __name__ == '__main__': umapper = umap.UMAP() test_embeddings = np.random.normal(size=(100, 64)) umap_embeddings = umapper.fit_transform(test_embeddings)
I have ran this code on ubuntu 22.04 LTS with umap-learn==0.5.3 and pytorch-metric-learning==2.2.0 and it works fine. Just some warnings for numba.jit decorator.