I changed the Pytorch-1.0 branch to make it work with Pytorch 1.6.0 and CUDA 10.2 (on python 3.6.11).
To install you'll need to:
Download the code with these changes
Open a terminal and go to the densefusion directory
Run the following commands:
pip install opencv-python scipy pyyaml
cd lib/knn
python setup.py install
cd dist
unzip knn_pytorch-0.1-py3.6-linux-x86_64.egg
cp knn_pytorch/knn_pytorch.py ../knn_pytorch.py
cp knn_pytorch/knn_pytorch.cpython-36m-x86_64-linux-gnu.so ../knn_pytorch.cpython-36m-x86_64-linux-gnu.so
cd ../../..
The changes are:
Line 38 on lib/knn/src/knn.h:
From this: dist_dev, idx_dev + b * k * query_nb, THCState_getCurrentStream(state));
to this: dist_dev, idx_dev + b * k * query_nb, at::cuda::getCurrentCUDAStream());
since THCState_getCurrentStream(state) is deprecated (see here and here)
Adapted class KNearestNeighbor from /lib/knn/init.py and /lib/loss.py accordingly to solve the issue Legacy autograd function with non-static forward method is deprecated following the documentation
I changed the Pytorch-1.0 branch to make it work with Pytorch 1.6.0 and CUDA 10.2 (on python 3.6.11).
To install you'll need to:
The changes are:
dist_dev, idx_dev + b * k * query_nb, THCState_getCurrentStream(state));
to this:dist_dev, idx_dev + b * k * query_nb, at::cuda::getCurrentCUDAStream());
sinceTHCState_getCurrentStream(state)
is deprecated (see here and here)KNearestNeighbor
from /lib/knn/init.py and /lib/loss.py accordingly to solve the issue Legacy autograd function with non-static forward method is deprecated following the documentation