UaNet icon indicating copy to clipboard operation
UaNet copied to clipboard

Custom nms build needs changes to work with new PyTorch

Open monajemi-arman opened this issue 1 year ago • 1 comments

Building in UaNet/src/build/box fails due to deprecated code.

monajemi-arman avatar Sep 10 '24 17:09 monajemi-arman

sed -i 's/AT_CHECK/TORCH_CHECK/g' box.cpp overlap.cpp nms.cpp sed -i 's/data</data_ptr</g' box.cpp overlap.cpp nms.cpp

Making the above changes fixes the issue. Also, for building, instead of python setup.py install you better use: python -m build --no-isolation

  • --no-isolation in order to get current env torch

A last notice, when importing the resulting 'box' module, you must always import torch first, else you get an error saying: ImportError: libc10.so: cannot open shared object file: No such file or directory Import torch first, and then box, you won't get an error.

monajemi-arman avatar Sep 10 '24 17:09 monajemi-arman