j96w / DenseFusion

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

Pytorch 1.6 #169

Closed drapado closed 4 years ago

drapado commented 4 years ago

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:

  1. Download the code with these changes
  2. Open a terminal and go to the densefusion directory
  3. 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:

  4. 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)
  5. 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
drapado commented 4 years ago

Close because I found an error, will re-upload soon

opr-sergey commented 3 years ago

@drapado you resolved error, i have same problem