NVlabs / PWC-Net

PWC-Net: CNNs for Optical Flow Using Pyramid, Warping, and Cost Volume, CVPR 2018 (Oral)
Other
1.63k stars 357 forks source link

Errors met when using the correlation package for PyTorch #103

Open shuaiyuan1996 opened 4 years ago

shuaiyuan1996 commented 4 years ago

Hi,

It seems that I have installed the external correlation package for PyTorch successfully (no error messages shown), but when I use the Correlation module under the package, I get the following error.

AttributeError: module 'correlation_package._ext.corr' has no attribute 'corr_cuda_forward'

Does anyone have the same problem? Any ideas on how to fix this?

My software environment: Python 3.6, PyTorch 0.4.0, CUDA 8.0.

Thanks! :)

ShoufaChen commented 4 years ago

I solved this problem by replacing the Correlation package here with the one provided by FlowNet2.

First, download correlation_package to PWC-Net/PyTorch/models/. That looks like:

PWC-Net/PyTorch/models/
    correlation_package
    PWCNet.py
    __init__.py

Then, build the package:

cd  PWC-Net/PyTorch/models/correlation_package
python3 setup.py install --user

Finally, change the import at PWCNet.py line 13

from:

from correlation_package.modules.corr import Correlation 

to:

from .correlation_package.correlation import Correlation
xiedidan commented 4 years ago

I got Segmentation fault (core dumped) with the FlowNet2 Correlation package.
I'm using python 3.7, pytorch 1.4 and cuda 10.1.
Not sure how to solve this...

teejs2012 commented 4 years ago

I have encountered error when trying to compile the correlation package. Managed to resolve by compiling it from here (https://github.com/vt-vl-lab/pwc-net.pytorch) and move over the generated folders