Closed ramonemiliani93 closed 1 month ago
Hi @ramonemiliani93,
Thanks for reporting this. It is indeed a very odd behaviour. From the example and macOS, I can infer that this error is coming from CPU execution (i.e. both your tensors are on cpu device), is this correct?
Did you try the unsigned geodesic functions directly? It may help debug further if you try those as well because signed distance is calling those functions internally...
Also please indicate you gcc/g++ or related compiler version that you are using for installation
Hi @ramonemiliani93
I have looked into this with the same OS, Python and Pytorch versions that you mentioned failing here. It seems like in your case there is some conflict between what is used for compiling the library (often referred to as build dependency) and what you have installed in the virtualenv. This is related to issue report here: https://github.com/masadcv/FastGeodis/issues/6#issuecomment-1166380502
Can you try the following:
pip install FastGeodis --no-build-isolation --no-cache-dir
This should resolve the issue you are seeing. Please do let me know if it doesnt.
Hi @masadcv! Thanks a lot! This has solved the issue 💪 Tried it with torch 2.2.2 and it works 🙌
Hi 👋
First, I want to thank you for the amazing library 🙌. I'm encountering an issue while trying to run a simple example, and I would greatly appreciate any help or guidance you can provide.
Describe the bug There is an error on
PyTorch==2.2.2
when running thesigned_generalised_geodesic3d
method.To Reproduce Steps to reproduce the behavior:
pyenv local 3.10
python -m venv .venv
source .venv/bin/activate
pip install "torch==xxx" FastGeodis
Expected behavior The method should compute the signed map and not raise
ValueError: function only supports 2D spatial inputs, received <number>
. From the torch versions I tried (all with python 3.10):torch==2.4.0
✅torch==2.3.1
✅torch==2.2.2
❌ValueError: function only supports 2D spatial inputs, received 69578766
torch==2.1.2
❌ImportError: dlopen(/Users/ramon/afxmedical/fastgeodis-bug/.venv/lib/python3.10/site-packages/FastGeodisCpp.cpython-310-darwin.so, 0x0002): Symbol not found: __ZN2at4_ops10empty_like4callERKNS_6TensorENSt3__18optionalIN3c1010ScalarTypeEEENS6_INS7_6LayoutEEENS6_INS7_6DeviceEEENS6_IbEENS6_INS7_12MemoryFormatEEE Referenced from: <F61DC557-D8F2-383F-AF8E-372C708E3C08>
torch==2.0.1
❌ImportError: dlopen(/Users/ramon/afxmedical/fastgeodis-bug/.venv/lib/python3.10/site-packages/FastGeodisCpp.cpython-310-darwin.so, 0x0002): Symbol not found: __ZN2at4_ops10empty_like4callERKNS_6TensorENSt3__18optionalIN3c1010ScalarTypeEEENS6_INS7_6LayoutEEENS6_INS7_6DeviceEEENS6_IbEENS6_INS7_12MemoryFormatEEE Referenced from: <F61DC557-D8F2-383F-AF8E-372C708E3C08>
Desktop (please complete the following information):