j96w / DenseFusion

"DenseFusion: 6D Object Pose Estimation by Iterative Dense Fusion" code repository
https://sites.google.com/view/densefusion
MIT License
1.07k stars 300 forks source link

AttributeError: module 'lib.knn.knn_pytorch' has no attribute 'knn' #183

Open maplect opened 3 years ago

maplect commented 3 years ago

I use anaconda, pytorch=1.4

balevin commented 3 years ago

Did you find a solution to this? I am having the same problem @maplect

adamchang2000 commented 2 years ago

I bypassed all [knn] related issues by just grabbing a different [knn] CUDA implementation from pip. https://github.com/unlimblue/KNN_CUDA.

It requires a little changing of the format of [pred] and [target] whenever [knn] is called (probably need to remove some calls to [torch.transpose]).

immanuelvalencia commented 2 years ago

I used pytorch=1.0.1. When running the train_linemod.sh command, I had an error with knn.

To fix, Go to lib/knn then run

python setup.py install

This will generate a file knn_pytorch-0.1-py3.6-linux-x86_64.egg located in the dist folder. Go to dist/knn_pytorch-0.1....../knn_pytorch then copy these two

knn_pytorch.cpython-36m-x86_64-linux-gnu.so knn_pytorch.py

paste in the lib/knn folder.

Cheers! `