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 1 week ago

monajemi-arman commented 1 week ago

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

monajemi-arman commented 1 week 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.