Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pytorch-metric-learning and fit_transform() in umap togather cause segementation fault #617

Open
ZhuoxuanLiu opened this issue Apr 23, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ZhuoxuanLiu
Copy link

ZhuoxuanLiu commented Apr 23, 2023

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

@ZhuoxuanLiu ZhuoxuanLiu changed the title import AccuracyCalculator and using fit_transform() in umap togather cause segementation fault Using pytorch-metric-learning and fit_transform() in umap togather cause segementation fault Apr 23, 2023
@KevinMusgrave KevinMusgrave added the question A general question about the library label Apr 23, 2023
@KevinMusgrave
Copy link
Owner

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

@KevinMusgrave
Copy link
Owner

KevinMusgrave commented Apr 23, 2023

Do you mean your code works if you remove the AccuracyCalculator import?

@ZhuoxuanLiu
Copy link
Author

Do you mean your code works if you remove the AccuracyCalculator import?

yes. In my env, pml can't work with umap.

@KevinMusgrave
Copy link
Owner

Wow, strange. I'll reopen the issue.

@KevinMusgrave KevinMusgrave reopened this Apr 24, 2023
@KevinMusgrave KevinMusgrave added bug Something isn't working and removed question A general question about the library labels Apr 24, 2023
@domenicoMuscill0
Copy link
Contributor

domenicoMuscill0 commented Jun 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants