uci-cbcl / UaNet

Other
59 stars 18 forks source link

Custom nms build needs changes to work with new PyTorch #6

Open monajemi-arman opened 2 months ago

monajemi-arman commented 2 months ago

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

monajemi-arman commented 2 months ago

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

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.