masadcv / FastGeodis

Fast Implementation of Generalised Geodesic Distance Transform for CPU (OpenMP) and GPU (CUDA)
https://fastgeodis.readthedocs.io
BSD 3-Clause "New" or "Revised" License
90 stars 14 forks source link

[BUG] pip install bug #51

Closed lfz closed 1 year ago

lfz commented 1 year ago

FastGeodis/geodis_fastmarch.cpp: In functiona'at::Tensor gradient2d(at::Tensor)': FastGeodis/geodis_fastmarch.cpp:87:46: error: 'kSame' is not a member of 'torch 87 .padding(torch::kSame) FastGeodis/geodis_fastmarch.cpp:95:46: error: 'kSame' is not a member of 'torch' 95 .padding(torch::kSame) FastGeodis/geodis_fastmarch.cpp: In function 'at::Tensor gradient3d(at::Tensor)': FastGeodis/geodis_fastmarch.cpp:281:46: error: 'kSame' is not a member of 'torch' 281 .padding(torch::kSame) FastGeodis/geodis_fastmarch.cpp:289:46: error: 'kSame' is not a member of N'torch 289 .padding(torch::kSame) FastGeodis/geodis_fastmarch.cpp:297:46: error: 'kSame' is not a member of 'torch' 297 .padding(torch::kSame)

623b5dd5-666d-4b3a-b202-74bba324e54e 00dc13a5-9cab-4833-acc1-2abbd8eec94d

masadcv commented 1 year ago

Many thanks for reporting this. I will have a look into this error over the weekend!

Could you in the meantime try to complie/install this with latest pytorch version?

masadcv commented 1 year ago

This error was due to incompatibility of much older versions of Pytorch. These versions do not have same padding which I was using in my C++ implementation of FastMarching method.

I have fixed this by having a more compatible implementation that works with previous versions of pytorch as well as recent ones (albeit with a minor hit on timing performance of FastMarching method only)...

Could you update to FastGeodis==1.0.4 and give this a try again? Please make sure to uninstall or selection -U option to ensure you download/compile/install version 1.0.4 which has this fix.

If any issues, please do not hesitate to write here with details of your setup etc..