NVIDIA / flownet2-pytorch

Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
Other
3.15k stars 741 forks source link

Issue with correlation_cuda #259

Open kayleeliyx opened 3 years ago

kayleeliyx commented 3 years ago

I could not import correlation_cuda and got this error everytime I import it:

correlation_cuda-0.0.0-py3.6-linux-x86_64.egg/correlation_cuda.cpython-36m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass

I use torch-1.7.1+cu110 torchaudio-0.7.2 torchvision-0.8.2+cu110

ajinkyakhoche commented 3 years ago

I have the exact same issue. It seems you are constrained to use lower PyTorch versions

Yee-Sing commented 5 months ago

There are 3 steps to solve this issue in my environment :1. setup.py ,edit ‘nvcc_args’ like this :nvcc_args = [

'-gencode', 'arch=compute_50,code=sm_50',

# '-gencode', 'arch=compute_52,code=sm_52',
# '-gencode', 'arch=compute_60,code=sm_60',
# '-gencode', 'arch=compute_61,code=sm_61',
# '-gencode', 'arch=compute_70,code=sm_70',
# '-gencode', 'arch=compute_70,code=compute_70'
'-gencode', 'arch=compute_86,code=sm_86',
'-gencode', 'arch=compute_86,code=compute_86'

];

  1. setup.py ,edit ‘cxx_args’ like this :# cxx_args = ['-std=c++11'] cxx_args = ['-std=c++14'];
  2. setup.py ,edit ‘cmdclass’ like this :# cmdclass={'build_ext': BuildExtension}, cmdclass={'build_ext': BuildExtension.with_options(use_ninja=False)}.