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

"Segmentation fault: 11" error when using pretrained dataset #79

Open
YannRoussel opened this issue Aug 9, 2022 · 2 comments
Open

"Segmentation fault: 11" error when using pretrained dataset #79

YannRoussel opened this issue Aug 9, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@YannRoussel
Copy link

YannRoussel commented Aug 9, 2022

Hello,

I am trying to use pre-trained models downloaded following this guide but I get the "Segmentation fault: 11" error even if I use a dummy dataset (i.e. a numpy array of the right shape filled with 0)

I use this script:

d = torch.load("morphoclass/dvc/training/checkpoints-alt-neurites/pc-L6-all-image-tmd-proj-xgb-stratified-k-fold/checkpoint.chk")
model = d["all"]["model"]

dummy = np.zeros((100, 10000))
model.predict(dummy)

I also tried with another model (pc-L5-all-image-tmd-rd-xgb-stratified-k-fold) and with an actual dataset of persistence images but get the same error.

Thank you for your help,

Yann Roussel.

@FrancescoCasalegno FrancescoCasalegno added the bug Something isn't working label Aug 15, 2022
@FrancescoCasalegno FrancescoCasalegno self-assigned this Aug 15, 2022
@FrancescoCasalegno
Copy link
Contributor

Hi @YannRoussel ,

I tried to reproduce your snippet but it works fine for me:

>>> model.predict(dummy)

array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])

Could you please check your environment?

  • Python version should be 3.8, see here
  • xgboost version should be 1.4.2, see here

If the two points above don't solve it try also pip install -r requirements.txt to make sure you have the exact same versions for the Python packages as we used to train the models.

@YannRoussel
Copy link
Author

YannRoussel commented Aug 16, 2022

Hi @FrancescoCasalegno ,

Thank you for the help! my python version is Python 3.8.13 and I have xgboost==1.4.2.

I have pip install -r requirements.txt and got:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sphinx-bluebrain-theme 0.2.11 requires Jinja2~=3.0.0, but you have jinja2 2.11.3 which is incompatible.
dvc 2.16.0 requires tqdm<5,>=4.63.1, but you have tqdm 4.53.0 which is incompatible.
dvc-objects 0.1.6 requires tqdm<5,>=4.63.1, but you have tqdm 4.53.0 which is incompatible.

Successfully installed Cython-0.29.32 Flask-1.1.2 argparse-1.4.0 captum-0.3.1 cleanlab-1.0 click-8.1.2 dash-1.19.0 dash-bootstrap-components-0.12.0 dash-core-components-1.15.0 dash-html-components-1.1.2 dash-table-4.11.2 dash_renderer-1.9.0 deepwalk-1.0.3 dill-0.3.3 futures-3.0.5 gensim-4.1.0 imbalanced-learn-0.8.0 jinja2-2.11.3 matplotlib-3.5.1 morphology-workflows-0.3.0 networkx-2.5 neurom-3.1.0 numpy-1.21.0 pandas-1.3.4 plotly-5.4.0 scikit-learn-1.0.1 scipy-1.7.3 seaborn-0.11.0 shap-0.39.0 torch-1.7.1 tqdm-4.53.0 umap-learn-0.5.1 wheel-0.37.1

I also re-run my dummy script and got:

OSError: dlopen(/Users/yroussel/PycharmProjects/pythonProject/scala_morpho_classification/morphoclass/myvenv/lib/python3.8/site-packages/torch_sparse/_version_cpu.so, 0x0006): Symbol not found: __ZN3c106detail12infer_schema20make_function_schemaENS_8ArrayRefINS1_11ArgumentDefEEES4_
  Referenced from: /Users/yroussel/PycharmProjects/pythonProject/scala_morpho_classification/morphoclass/myvenv/lib/python3.8/site-packages/torch_sparse/_version_cpu.so
  Expected in: /Users/yroussel/PycharmProjects/pythonProject/scala_morpho_classification/morphoclass/myvenv/lib/python3.8/site-packages/torch/lib/libtorch_cpu.dylib

Could this be related to the Jinja2 from the requirements.txt? Should I try to pip install Jinja2==3.0.0 manually?

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

2 participants