Coder Social home page Coder Social logo

pytorch-correlation-extension's Introduction

Hi there 👋

Clement's github stats

  • Reasearch engineer at ENSTA Paris, U2IS lab
  • My main research topics are Computer Vision, Geometry and robotics
  • Personal website : https://clementpinard.fr

pytorch-correlation-extension's People

Contributors

bhack avatar brannondorsey avatar clementpinard avatar innovarul avatar manueldiaz96 avatar shandelier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorch-correlation-extension's Issues

GCC error

Thanks for the work, but I still have some troubles to compile the module. Following is my environment settings:

>> python
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.1.0
>> nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
>> gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>> g++ --version
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

And I got these errors:
>> python setup.py install

running install
running bdist_egg
running egg_info
writing Correlation_Module/spatial_correlation_sampler.egg-info/PKG-INFO
writing dependency_links to Correlation_Module/spatial_correlation_sampler.egg-info/dependency_links.txt
writing requirements to Correlation_Module/spatial_correlation_sampler.egg-info/requires.txt
writing top-level names to Correlation_Module/spatial_correlation_sampler.egg-info/top_level.txt
reading manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
writing manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'spatial_correlation_sampler_backend' extension
gcc -pthread -B /home/cvpr/anaconda3/envs/pwcnet/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include/TH -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/cvpr/anaconda3/envs/pwcnet/include/python3.7m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/cvpr/anaconda3/envs/pwcnet/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include/TH -I/home/cvpr/anaconda3/envs/pwcnet/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/cvpr/anaconda3/envs/pwcnet/include/python3.7m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
Correlation_Module/correlation_sampler.cpp: In function ‘at::Tensor correlation_sample_forward(at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int)’:
Correlation_Module/correlation_sampler.cpp:29:23: error: ‘TORCH_CHECK’ was not declared in this scope
#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDA tensor")
^
Correlation_Module/correlation_sampler.cpp:31:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^~~~~~~~~~
Correlation_Module/correlation_sampler.cpp:63:5: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(input1);
^~~~~~~~~~~
Correlation_Module/correlation_sampler.cpp:29:23: note: suggested alternative: ‘AT_CHECK’
#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDA tensor")
^
Correlation_Module/correlation_sampler.cpp:31:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^~~~~~~~~~
Correlation_Module/correlation_sampler.cpp:63:5: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(input1);
^~~~~~~~~~~
Correlation_Module/correlation_sampler.cpp: In function ‘std::vectorat::Tensor correlation_sample_backward(at::Tensor, at::Tensor, at::Tensor, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t)’:
Correlation_Module/correlation_sampler.cpp:29:23: error: ‘TORCH_CHECK’ was not declared in this scope
#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDA tensor")
^
Correlation_Module/correlation_sampler.cpp:31:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^~~~~~~~~~
Correlation_Module/correlation_sampler.cpp:89:5: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(input1);
^~~~~~~~~~~
Correlation_Module/correlation_sampler.cpp:29:23: note: suggested alternative: ‘AT_CHECK’
#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDA tensor")
^
Correlation_Module/correlation_sampler.cpp:31:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^~~~~~~~~~
Correlation_Module/correlation_sampler.cpp:89:5: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(input1);
^~~~~~~~~~~
error: command 'gcc' failed with exit status 1

Output shape does not reflect dilation_patch parameter.

The dilation_patch parameter seems not correctly interpreted:

>>> import torch
>>> from spatial_correlation_sampler import SpatialCorrelationSampler
>>> x = torch.ones(1, 1, 10, 10)
>>> SpatialCorrelationSampler(patch_size=4, dilation_patch=1)(x, x).shape
torch.Size([1, 5, 5, 10, 10])
>>> SpatialCorrelationSampler(patch_size=5, dilation_patch=2)(x, x).shape
torch.Size([1, 5, 5, 10, 10])
>>> SpatialCorrelationSampler(patch_size=5, dilation_patch=3)(x, x).shape
torch.Size([1, 5, 5, 10, 10])

Regardless of the stepping within the patch the output shape is just the same.

python benchmark.py try to allocate cuda memory 9177984325.83 GiB

when I try to run benchmark.py, it raise an error says that
RuntimeError: CUDA out of memory. Tried to allocate 9177984325.83 GiB (GPU 0; 5.93 GiB total capacity; 78.25 MiB already allocated; 4.44 GiB free; 0 bytes cached) (malloc at /pytorch/aten/src/THC/THCCachingAllocator.cpp:231)

here is my environments:
pytorch 1.0
cuda9.0

Is something wrong? thanks a lot.

Is it possible to use the module for 1d correlation only

Hi, thanks for the package!
Is it possible to use this module to perform 1D correlation?
By saying 1d correlation, I mean to do correlation only along X direction, or Y direction, or certain customized direction (e.g. along epipolar line) to save some computation.
if not, would you mind offer some hints to modify the code for that?

The padding parameter

I don't understand that padding operation influences both input1 and input2...

Why don't you just padding the input2?

for instance, if I have a pixel at the left-top position in input1, so the corresponding pixel in input2 is also at the left-top position, and the padding to the input2 is enough if I want to do the correlation operation around the pixel in input2. So why do you padding the input1 and end up enlarging the outH and outW?

Error running module on GPU

Hi Clement, I have been using your spatial-correlation-sampler. When I run python grad_check cpu it returns 'ok' but with backend option set as cuda, I get the following error:

Traceback (most recent call last):
File "grad_check.py", line 41, in
if gradcheck(correlation_sampler, [input1, input2]):
File "/home/bowen/anaconda3/lib/python3.6/site-packages/torch/autograd/gradcheck.py", line 190, in gradcheck
output = _differentiable_outputs(func(inputs))
File "/home/bowen/anaconda3/lib/python3.6/site-packages/spatial_correlation_sampler/spatial_correlation_sampler.py", line 73, in forward
dH, dW)
RuntimeError: sizes must be non-negative (THCTensor_resizeNd at /opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCTensor.cpp:108)
frame #0: THCudaDoubleTensor_newWithStorage + 0xfa (0x7fe7c042c9aa in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/lib/libcaffe2_gpu.so)
frame #1: at::CUDADoubleType::th_tensor(at::ArrayRef) const + 0xa5 (0x7fe7c02cf4e5 in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/lib/libcaffe2_gpu.so)
frame #2: at::native::tensor(at::Type const&, at::ArrayRef) + 0x3a (0x7fe7e34c37da in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/lib/libcaffe2.so)
frame #3: at::Type::tensor(at::ArrayRef) const + 0x9 (0x7fe7e36b1b69 in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/lib/libcaffe2.so)
frame #4: torch::autograd::VariableType::tensor(at::ArrayRef) const + 0x44 (0x7fe7e5333d04 in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #5: at::native::zeros(at::ArrayRef, at::TensorOptions const&) + 0x31 (0x7fe7e351a651 in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/lib/libcaffe2.so)
frame #6: + 0x231f9 (0x7fe7bca6e1f9 in /home/bowen/anaconda3/lib/python3.6/site-packages/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so)
frame #7: correlation_cuda_forward(at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int) + 0x167 (0x7fe7bca6f204 in /home/bowen/anaconda3/lib/python3.6/site-packages/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so)
frame #8: correlation_sample_forward(at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int) + 0x1b4 (0x7fe7bca60ed4 in /home/bowen/anaconda3/lib/python3.6/site-packages/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so)
frame #9: + 0x217b9 (0x7fe7bca6c7b9 in /home/bowen/anaconda3/lib/python3.6/site-packages/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so)
frame #10: + 0x1fc2d (0x7fe7bca6ac2d in /home/bowen/anaconda3/lib/python3.6/site-packages/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so)

frame #18: THPFunction_do_forward(THPFunction
, _object*) + 0x2ad (0x7fe7e5310fbd in /home/bowen/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #35: __libc_start_main + 0xf5 (0x7fe7f9c8af45 in /lib/x86_64-linux-gnu/libc.so.6)

I also tried to pass some tensors into the module in the console. Calling forward and backward seems to be fine as long as computation is on cpu. The module crashes once I put the same tensor on GPU.

Code is running on Ubuntu 14.04. I am using anaconda python 3.6.5. My pytorch version is 0.4.1. And I am using CUDA 9.0.

It is worth mentioning that I had trouble installing the code, as I later discovered that nvcc is using gcc-6.0 which is incompatible with my CUDA 9.0 and I redirected the softlink to gcc-4.9. By doing this I am able to compile and install. Not sure if it is related to this crash.

Please let me know what you think. Thank you!

patch_dilation seems problemetic

Hi @ClementPinard , I find something wrong when I use patch_dilation>1. The output shape looks good to me, but the value is weird to me. Here is an example:

import torch
from spatial_correlation_sampler import SpatialCorrelationSampler

torch.manual_seed(0)

device = "cuda"
batch_size =1 
channel =1
H = 10
W = 10
dtype = torch.float32

B = batch_size
kernel_size = 1
patch = 3
stride = 1
pad = 0
patch_dilation = 2

input1 = torch.randint(1,4,(batch_size,channel,H,W),dtype=dtype,device=device,requires_grad=True)
input2 = torch.randint_like(input1,1,4).requires_grad_(True)

correlation_sampler = SpatialCorrelationSampler(
    kernel_size,
    patch,
    stride,
    pad,
    patch_dilation)

out = correlation_sampler(input1,input2)

print(out.shape)
print(input1[0])
print(input2[0])
print(out[0,:,:,0,0])

The output is:

tensor([[[2., 1., 2., 2., 3., 1., 3., 3., 3., 1.],
         [3., 2., 2., 3., 3., 1., 2., 3., 3., 2.],
         [1., 1., 3., 2., 3., 2., 1., 1., 2., 2.],
         [3., 2., 3., 2., 3., 1., 1., 3., 1., 1.],
         [2., 3., 3., 2., 1., 2., 3., 1., 2., 3.],
         [1., 1., 2., 3., 3., 1., 1., 2., 2., 1.],
         [3., 2., 1., 3., 3., 1., 3., 1., 3., 2.],
         [3., 3., 2., 2., 3., 1., 2., 2., 1., 2.],
         [1., 1., 3., 1., 3., 3., 1., 2., 3., 1.],
         [3., 2., 2., 1., 1., 1., 1., 1., 2., 2.]]], device='cuda:0',
       grad_fn=<SelectBackward>)
tensor([[[2., 2., 1., 1., 3., 1., 1., 1., 1., 3.],
         [2., 1., 3., 3., 2., 2., 1., 1., 2., 3.],
         [2., 2., 2., 2., 1., 2., 2., 1., 1., 2.],
         [1., 3., 3., 3., 3., 3., 1., 1., 1., 3.],
         [1., 3., 1., 2., 3., 1., 2., 3., 3., 1.],
         [3., 1., 3., 1., 3., 2., 1., 2., 1., 2.],
         [3., 2., 2., 1., 1., 2., 2., 1., 2., 1.],
         [3., 2., 2., 1., 1., 3., 2., 1., 1., 1.],
         [1., 2., 3., 1., 1., 3., 3., 3., 3., 1.],
         [3., 2., 1., 3., 3., 3., 2., 2., 2., 2.]]], device='cuda:0',
       grad_fn=<SelectBackward>)
torch.Size([1, 3, 3, 10, 10])
tensor([[0., 0., 0.],
        [0., 4., 4.],
        [0., 4., 2.]], device='cuda:0', grad_fn=<SelectBackward>)

I manually compute the "dilated correlation", and I guess the result of out[0,:,:,0,0] should be:

0 0 0
0 4 2
0 4 4

which is:

A[0,0]* Matrix(
B[-2,-2] B[-2,0] B[-2,2]
B[0,-2] B[0,0] B[0,2]
B[-2,-2] B[-2,0] B[-2,2]
)

Output are all zero

I have used this correlate module, but the output tensor are all zero. I don't know why. My input tensors are all 'torch.cuda.FloatTensor'.
When I use cpu version, the output have non zero values, but when it converts to cuda version, the output value are all zero.

an illegal memory access was encountered

Hi, when I use your code in pytorch 0.4.1, cuda 9.0, an error occurs:
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1532571933727/work/aten/src/THC/THCCachingHostAllocator.cpp line=271 error=77 : an illegal memory access was encountered
if I do not use the correlation layer, that would be ok.
Do you have any idea? Thank you!

Error in pip3 install spatial-correlation-sampler

Hi, I try to install spatial_correlation_sampler with command,
pip3 install spatial_correlation_sampler
I get the follows errors,
error: command 'usr/local/cuda/bin/nvcc' failed with exit status 2.
I use Ubuntu16.04, CUDA8.0, Python3.5, Pytorch1.0.1, GCC 5.4
Can you provide your version of CUDA, Python, Pytorch and GCC?
Thank you!

Questions about the output shape

Hi @ClementPinard , thanks for this great work.
I'm having trouble comparing the output with your implementation against NVIDIA's. I observe that the output shape of your correlation_sampler is torch.Size([16, 3, 3, 100, 100]) while NVIDIA's implementation is torch.Size([16, 49, 94, 94]), given input size torch.Size([16, 64, 100, 100]) and other parameter shown in your benckmark scritps.
Would you please explain why you choose to output in this shape and how to convert them into NVIDIA's format? I didn't find an obvious conversion.
Thanks for your time.

error python setup.py install

Hi, My torch version 1.0.1.
When I run python setup.py install, there are some outputs:

torch-version 1.0.1.post2
running install
running bdist_egg
running egg_info
writing Correlation_Module/spatial_correlation_sampler.egg-info/PKG-INFO
writing dependency_links to Correlation_Module/spatial_correlation_sampler.egg-info/dependency_links.txt
writing requirements to Correlation_Module/spatial_correlation_sampler.egg-info/requires.txt
writing top-level names to Correlation_Module/spatial_correlation_sampler.egg-info/top_level.txt
reading manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
writing manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'spatial_correlation_sampler_backend' extension
gcc -pthread -B /media/data2/xly/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/media/data2/xly/anaconda3/include/python3.7m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /media/data2/xly/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/media/data2/xly/anaconda3/include/python3.7m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/media/data2/xly/anaconda3/include/python3.7m -c Correlation_Module/correlation_cuda_kernel.cu -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/pybind11/cast.h(1877): warning: nonstandard use of "auto" to both deduce the type from an initializer and to announce a trailing return type

1 error detected in the compilation of "/tmp/tmpxft_00004282_00000000-7_correlation_cuda_kernel.cpp1.ii".
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 2

Building wheel for spatial-correlation-sampler (setup.py) ... error

I have ubuntu16.04, python 3.6,,pytorch1.0.1, CUDA 9.0 and GCC 5.4.0,and I have the error. could you help me to solve it? Thank you very much!

Collecting spatial-correlation-sampler
Using cached https://files.pythonhosted.org/packages/a6/d1/aa0a71739ce998f655286d966c0ad7aff765648431c054c34db7d58b811b/spatial_correlation_sampler-0.1.0.tar.gz
Requirement already satisfied: torch>=1.0.1 in /home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages (from spatial-correlation-sampler) (1.0.1.post2)
Requirement already satisfied: numpy in /home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages (from spatial-correlation-sampler) (1.16.4)
Building wheels for collected packages: spatial-correlation-sampler
Building wheel for spatial-correlation-sampler (setup.py) ... error
ERROR: Complete output from command /home/zhu/anaconda2/envs/pytorch1.0/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-n71atlj0/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-i83mpbc9 --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/init.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
running build_ext
building 'spatial_correlation_sampler_backend' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Correlation_Module
gcc -pthread -B /home/zhu/anaconda2/envs/pytorch1.0/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/TH -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zhu/anaconda2/envs/pytorch1.0/include/python3.6m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.6/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/zhu/anaconda2/envs/pytorch1.0/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/TH -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zhu/anaconda2/envs/pytorch1.0/include/python3.6m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.6/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/TH -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zhu/anaconda2/envs/pytorch1.0/include/python3.6m -c Correlation_Module/correlation_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/Correlation_Module/correlation_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/ATen/core/jit_type.h(907): warning: statement is unreachable

/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:206: error: expansion pattern
‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:215: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:392: error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:395: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:397: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:397: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:412: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:149: error: expansion pattern ‘std::is_copy_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:240: error: expansion pattern ‘std::is_same<typename Container::value_type&, typename Container::reference>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:249: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:249: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:312: error: expansion pattern ‘std::is_copy_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:403: error: expansion pattern ‘std::is_same<typename Container::value_type&, typename Container::reference>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:406: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:406: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:408: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:408: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:423: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:425: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:126: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:170: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char16_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:214: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char32_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:257: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, wchar_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:262: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:138: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:186: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char16_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:234: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char32_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:281: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, wchar_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:286: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:301: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:303: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:121: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:169: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char16_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:217: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char32_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:264: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, wchar_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:269: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:284: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:286: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:112: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:137: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:164: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:187: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:192: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:201: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:251: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::is_copy_constructible >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:294: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:392: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:453: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:478: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:505: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:528: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:533: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:542: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:592: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::is_copy_constructible >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:635: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:733: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 5 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:738: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:738: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:753: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:755: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:121: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:146: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:173: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:196: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:201: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:210: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:250: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::move_always >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:293: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:391: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:452: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:477: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:504: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:527: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:532: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:541: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:581: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::move_always >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:624: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:722: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 5 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:727: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:727: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:742: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:744: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:100: error: expansion pattern ‘pybind11::detail::move_always’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:138: error: expansion pattern ‘pybind11::detail::move_if_unreferenced’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:141: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:141: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:143: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:155: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:99: error: expansion pattern ‘pybind11::detail::move_always’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:137: error: expansion pattern ‘pybind11::detail::move_if_unreferenced’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:140: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:140: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:142: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:154: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:145: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:154: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:278: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:281: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:283: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:283: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:298: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:146: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:155: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:279: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:282: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:284: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:284: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:299: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:113: error: expansion pattern ‘std::is_function<typename std::remove_reference<_From>::type>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:171: error: expansion pattern ‘std::is_pointer<typename std::remove_reference< >::type>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:236: error: expansion pattern ‘std::is_member_pointer<typename std::remove_reference< >::type>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:239: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:239: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:239: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:241: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:256: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h: In function ‘void pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: error: no matching function for call to ‘pybind11::cpp_function::cpp_function(pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>)’
[patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::)(Arg ...) const, const Extra& ...)
cpp_function(Return (Class::f)(Arg...) const, const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: note: mismatched types ‘Return (Class::
)(Arg ...) const’ and ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’
[patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::
)(Arg ...), const Extra& ...)
cpp_function(Return (Class::f)(Arg...), const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: note: mismatched types ‘Return (Class::
)(Arg ...)’ and ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’
[patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note: candidate: template<class Func, class ... Extra, class> pybind11::cpp_function::cpp_function(Func&&, const Extra& ...)
cpp_function(Func &&f, const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note: candidate: template<class Return, class ... Args, class ... Extra> pybind11::cpp_function::cpp_function(Return ()(Args ...), const Extra& ...)
cpp_function(Return (f)(Args...), const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: note: mismatched types ‘Return (
)(Args ...)’ and ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’
[patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note: candidate: pybind11::cpp_function::cpp_function(std::nullptr_t)
cpp_function(std::nullptr_t) { }
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note: no known conversion for argument 1 from ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’ to ‘std::nullptr_t’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note: candidate: pybind11::cpp_function::cpp_function()
cpp_function() { }
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note: candidate expects 0 arguments, 1 provided
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(const pybind11::cpp_function&)
class cpp_function : public function {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: no known conversion for argument 1 from ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’ to ‘const pybind11::cpp_function&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(pybind11::cpp_function&&)
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: no known conversion for argument 1 from ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’ to ‘pybind11::cpp_function&&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h: In function ‘std::pair<std::__detail::_Node_iterator<std::pair<_typeobject
const, std::vectorpybind11::detail::type_info* >, false, false>, bool> pybind11::detail::all_type_info_get_cache(PyTypeObject*)’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: error: no matching function for call to ‘pybind11::cpp_function::cpp_function(pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>)’
})).release();
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::)(Arg ...) const, const Extra& ...)
cpp_function(Return (Class::f)(Arg...) const, const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: note: mismatched types ‘Return (Class::
)(Arg ...) const’ and ‘pybind11::detail::all_type_info_get_cache(PyTypeObject
)::<lambda(pybind11::handle)>’
})).release();
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::)(Arg ...), const Extra& ...)
cpp_function(Return (Class::f)(Arg...), const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: note: mismatched types ‘Return (Class::
)(Arg ...)’ and ‘pybind11::detail::all_type_info_get_cache(PyTypeObject
)::<lambda(pybind11::handle)>’
})).release();
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note: candidate: template<class Func, class ... Extra, class> pybind11::cpp_function::cpp_function(Func&&, const Extra& ...)
cpp_function(Func &&f, const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note: candidate: template<class Return, class ... Args, class ... Extra> pybind11::cpp_function::cpp_function(Return ()(Args ...), const Extra& ...)
cpp_function(Return (f)(Args...), const Extra&... extra) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: note: mismatched types ‘Return (
)(Args ...)’ and ‘pybind11::detail::all_type_info_get_cache(PyTypeObject
)::<lambda(pybind11::handle)>’
})).release();
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note: candidate: pybind11::cpp_function::cpp_function(std::nullptr_t)
cpp_function(std::nullptr_t) { }
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note: no known conversion for argument 1 from ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’ to ‘std::nullptr_t’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note: candidate: pybind11::cpp_function::cpp_function()
cpp_function() { }
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note: candidate expects 0 arguments, 1 provided
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(const pybind11::cpp_function&)
class cpp_function : public function {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: no known conversion for argument 1 from ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’ to ‘const pybind11::cpp_function&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(pybind11::cpp_function&&)
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: no known conversion for argument 1 from ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’ to ‘pybind11::cpp_function&&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘T pybind11::object::cast() && [with T = std::basic_string]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/class.h:537:138: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1706:68: error: could not convert ‘pybind11::cast<std::basic_string >((* & std::movepybind11::object&(((pybind11::object)this))))’ from ‘int’ to ‘std::basic_string’
template T object::cast() && { return pybind11::cast(std::move(this)); }
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {}; Derived = pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:200:52: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments()’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::handle, pybind11::handle, pybind11::none, pybind11::str}; Derived = pybind11::handle]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:964:158: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::handle, pybind11::handle, pybind11::none, pybind11::str)’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::tuple&}; Derived = pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1720:39: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::tuple&)’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object&}; Derived = pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1738:11: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::object&)’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object}; Derived = pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1739:64: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::object)’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {const char
const&}; Derived = pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1333:35: required from ‘bool pybind11::detail::object_api::contains(T&&) const [with T = const char* const&; Derived = pybind11::handle]’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/internals.h:170:25: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(const char* const&)’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘int pybind11::cast(pybind11::object&&) [with T = std::basic_string]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1706:68: required from ‘T pybind11::object::cast() && [with T = std::basic_string]’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/class.h:537:138: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1702:24: error: cannot convert ‘std::basic_string’ to ‘int’ in return
return cast(object);
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::handle&, pybind11::handle&}; Derived = pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:884:28: required from ‘pybind11::str pybind11::str::format(Args&& ...) const [with Args = {pybind11::handle&, pybind11::handle&}]’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:749:72: required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::handle&, pybind11::handle&)’
return detail::collect_arguments(std::forward(args)...).call(derived().ptr());
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector pybind11::detail::collect_arguments(Args&& ...)
simple_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector pybind11::detail::collect_arguments(Args&& ...)
unpacking_collector collect_arguments(Args &&...args) {
^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: template argument deduction/substitution failed:
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

ERROR: Failed building wheel for spatial-correlation-sampler
Running setup.py clean for spatial-correlation-sampler
Failed to build spatial-correlation-sampler
Installing collected packages: spatial-correlation-sampler
Running setup.py install for spatial-correlation-sampler ... error
ERROR: Complete output from command /home/zhu/anaconda2/envs/pytorch1.0/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-n71atlj0/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pth6ozd7/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/init.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
running build_ext
building 'spatial_correlation_sampler_backend' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Correlation_Module
gcc -pthread -B /home/zhu/anaconda2/envs/pytorch1.0/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/TH -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zhu/anaconda2/envs/pytorch1.0/include/python3.6m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.6/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/zhu/anaconda2/envs/pytorch1.0/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/TH -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zhu/anaconda2/envs/pytorch1.0/include/python3.6m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.6/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/TH -I/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zhu/anaconda2/envs/pytorch1.0/include/python3.6m -c Correlation_Module/correlation_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/Correlation_Module/correlation_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/ATen/core/jit_type.h(907): warning: statement is unreachable

/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:206: error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:215: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:392: error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:395: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:397: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:397: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:412: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:149: error: expansion pattern ‘std::is_copy_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:240: error: expansion pattern ‘std::is_same<typename Container::value_type&, typename Container::reference>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:249: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:249: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:312: error: expansion pattern ‘std::is_copy_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:403: error: expansion pattern ‘std::is_same<typename Container::value_type&, typename Container::reference>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:406: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:406: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:408: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:408: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:423: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:425: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:126: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:170: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char16_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:214: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char32_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:257: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, wchar_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:260: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:960:262: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:138: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:186: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char16_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:234: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char32_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:281: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, wchar_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:284: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:286: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:301: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1250:303: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:121: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:169: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char16_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:217: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, char32_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:264: error: expansion pattern ‘pybind11::detail::negation<std::is_same<CharT, wchar_t> >’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:267: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:269: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:284: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1261:286: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:112: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:137: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:164: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:187: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:190: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:192: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:201: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:251: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::is_copy_constructible<T1> >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:294: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:392: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type<T>::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:401: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:453: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:478: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:505: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:528: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:531: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:533: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:542: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:592: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::is_copy_constructible<T1> >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:635: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:733: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type<T>::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:736: error: template argument 5 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:738: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:738: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:753: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1584:755: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:121: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:146: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:173: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:196: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:199: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:201: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:210: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:250: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::move_always<T> >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:293: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:391: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type<T>::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:400: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:452: error: expansion pattern ‘std::is_void<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:477: error: expansion pattern ‘std::is_pointer<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:504: error: expansion pattern ‘std::is_reference<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:527: error: expansion pattern ‘std::is_const<_Tp>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:530: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:532: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:541: error: expected parameter pack before ‘...’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:581: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::move_always<T> >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:624: error: expansion pattern ‘std::is_move_constructible<_Tp>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:722: error: expansion pattern ‘std::is_same<decltype (declval<pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type<T>::type, void> >().operator T&()), T&>::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 4 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:725: error: template argument 5 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:727: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:727: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:742: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1591:744: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:100: error: expansion pattern ‘pybind11::detail::move_always<T>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:138: error: expansion pattern ‘pybind11::detail::move_if_unreferenced<T>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:141: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:141: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:143: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1671:155: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:99: error: expansion pattern ‘pybind11::detail::move_always<T>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:137: error: expansion pattern ‘pybind11::detail::move_if_unreferenced<T>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:140: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:140: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:142: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1701:154: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:145: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:154: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:278: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:281: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:283: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:283: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2075:298: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:146: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:155: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:279: error: expansion pattern ‘pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::args_proxy, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > > >::value’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:282: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:284: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:284: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2082:299: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:113: error: expansion pattern ‘std::is_function<typename std::remove_reference<_From>::type>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:171: error: expansion pattern ‘std::is_pointer<typename std::remove_reference< <template-parameter-1-1> >::type>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:236: error: expansion pattern ‘std::is_member_pointer<typename std::remove_reference< <template-parameter-1-1> >::type>’ contains no argument packs
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:239: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:239: error: template argument 2 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:239: error: template argument 3 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:241: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:64:256: error: template argument 1 is invalid
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h: In function ‘void pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: error: no matching function for call to ‘pybind11::cpp_function::cpp_function(pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>)’
             [patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
                                                      ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...) const, const Extra& ...)
     cpp_function(Return (Class::*f)(Arg...) const, const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: note:   mismatched types ‘Return (Class::*)(Arg ...) const’ and ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’
             [patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
                                                      ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...), const Extra& ...)
     cpp_function(Return (Class::*f)(Arg...), const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: note:   mismatched types ‘Return (Class::*)(Arg ...)’ and ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’
             [patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
                                                      ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note: candidate: template<class Func, class ... Extra, class> pybind11::cpp_function::cpp_function(Func&&, const Extra& ...)
     cpp_function(Func &&f, const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note: candidate: template<class Return, class ... Args, class ... Extra> pybind11::cpp_function::cpp_function(Return (*)(Args ...), const Extra& ...)
     cpp_function(Return (*f)(Args...), const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1499:54: note:   mismatched types ‘Return (*)(Args ...)’ and ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’
             [patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); });
                                                      ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note: candidate: pybind11::cpp_function::cpp_function(std::nullptr_t)
     cpp_function(std::nullptr_t) { }
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note:   no known conversion for argument 1 from ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’ to ‘std::nullptr_t’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note: candidate: pybind11::cpp_function::cpp_function()
     cpp_function() { }
         ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note:   candidate expects 0 arguments, 1 provided
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(const pybind11::cpp_function&)
 class cpp_function : public function {
       ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note:   no known conversion for argument 1 from ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’ to ‘const pybind11::cpp_function&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(pybind11::cpp_function&&)
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note:   no known conversion for argument 1 from ‘pybind11::detail::keep_alive_impl(pybind11::handle, pybind11::handle)::<lambda(pybind11::handle)>’ to ‘pybind11::cpp_function&&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h: In function ‘std::pair<std::__detail::_Node_iterator<std::pair<_typeobject* const, std::vector<pybind11::detail::type_info*> >, false, false>, bool> pybind11::detail::all_type_info_get_cache(PyTypeObject*)’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: error: no matching function for call to ‘pybind11::cpp_function::cpp_function(pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>)’
         })).release();
   ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...) const, const Extra& ...)
     cpp_function(Return (Class::*f)(Arg...) const, const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:79:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: note:   mismatched types ‘Return (Class::*)(Arg ...) const’ and ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’
         })).release();
   ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note: candidate: template<class Return, class Class, class ... Arg, class ... Extra> pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...), const Extra& ...)
     cpp_function(Return (Class::*f)(Arg...), const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:72:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: note:   mismatched types ‘Return (Class::*)(Arg ...)’ and ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’
         })).release();
   ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note: candidate: template<class Func, class ... Extra, class> pybind11::cpp_function::cpp_function(Func&&, const Extra& ...)
     cpp_function(Func &&f, const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:65:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note: candidate: template<class Return, class ... Args, class ... Extra> pybind11::cpp_function::cpp_function(Return (*)(Args ...), const Extra& ...)
     cpp_function(Return (*f)(Args...), const Extra&... extra) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:58:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1535:3: note:   mismatched types ‘Return (*)(Args ...)’ and ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’
         })).release();
   ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note: candidate: pybind11::cpp_function::cpp_function(std::nullptr_t)
     cpp_function(std::nullptr_t) { }
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:54:1: note:   no known conversion for argument 1 from ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’ to ‘std::nullptr_t’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note: candidate: pybind11::cpp_function::cpp_function()
     cpp_function() { }
         ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:53:9: note:   candidate expects 0 arguments, 1 provided
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(const pybind11::cpp_function&)
 class cpp_function : public function {
       ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note:   no known conversion for argument 1 from ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’ to ‘const pybind11::cpp_function&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note: candidate: pybind11::cpp_function::cpp_function(pybind11::cpp_function&&)
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:51:7: note:   no known conversion for argument 1 from ‘pybind11::detail::all_type_info_get_cache(PyTypeObject*)::<lambda(pybind11::handle)>’ to ‘pybind11::cpp_function&&’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘T pybind11::object::cast() && [with T = std::basic_string<char>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/class.h:537:138:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1706:68: error: could not convert ‘pybind11::cast<std::basic_string<char> >((* & std::move<pybind11::object&>((*(pybind11::object*)this))))’ from ‘int’ to ‘std::basic_string<char>’
 template <typename T> T object::cast() && { return pybind11::cast<T>(std::move(*this)); }
                                                                    ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:200:52:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments()’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::handle, pybind11::handle, pybind11::none, pybind11::str}; Derived = pybind11::handle]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:964:158:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::handle, pybind11::handle, pybind11::none, pybind11::str)’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::tuple&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1720:39:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::tuple&)’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1738:11:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::object&)’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:1739:64:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::object)’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {const char* const&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1333:35:   required from ‘bool pybind11::detail::object_api<Derived>::contains(T&&) const [with T = const char* const&; Derived = pybind11::handle]’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/internals.h:170:25:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(const char* const&)’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘int pybind11::cast(pybind11::object&&) [with T = std::basic_string<char>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1706:68:   required from ‘T pybind11::object::cast() && [with T = std::basic_string<char>]’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/class.h:537:138:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:1702:24: error: cannot convert ‘std::basic_string<char>’ to ‘int’ in return
     return cast<T>(object);
                        ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::handle&, pybind11::handle&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:884:28:   required from ‘pybind11::str pybind11::str::format(Args&& ...) const [with Args = {pybind11::handle&, pybind11::handle&}]’
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:749:72:   required from here
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2097:44: error: no matching function for call to ‘collect_arguments(pybind11::handle&, pybind11::handle&)’
     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                            ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 simple_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2076:1: note:   template argument deduction/substitution failed:
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
 unpacking_collector<policy> collect_arguments(Args &&...args) {
 ^
/home/zhu/anaconda2/envs/pytorch1.0/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:2083:1: note:   template argument deduction/substitution failed:
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
----------------------------------------

ERROR: Command "/home/zhu/anaconda2/envs/pytorch1.0/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-n71atlj0/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pth6ozd7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-n71atlj0/spatial-correlation-sampler/

import error: run benchmark.py

when I run
python benchmark.py cpu

Traceback (most recent call last):
File "benchmark.py", line 8, in
from spatial_correlation_sampler import SpatialCorrelationSampler
File "/media/data2/xly/anaconda3/lib/python3.7/site-packages/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg/spatial_correlation_sampler/init.py", line 1, in
from .spatial_correlation_sampler import SpatialCorrelationSampler, SpatialCorrelationSamplerFunction, spatial_correlation_sample
File "/media/data2/xly/anaconda3/lib/python3.7/site-packages/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg/spatial_correlation_sampler/spatial_correlation_sampler.py", line 6, in
import spatial_correlation_sampler_backend as correlation
ImportError: /media/data2/xly/anaconda3/lib/python3.7/site-packages/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _Z25correlation_cuda_backwardN2at6TensorES0_S0_iiiiiiiiii

Correlation always zero if multiple GPUs

The following code snippet reproduces the bug:

import torch
from spatial_correlation_sampler import spatial_correlation_sample


def run_spatial_corr(rank):
    corr = spatial_correlation_sample(torch.ones(1, 512, 12, 27).to(f"cuda:{rank}"),
                                      torch.ones(1, 512, 12, 27).to(f"cuda:{rank}")).mean()
    print(corr)

run_spatial_corr(0)
run_spatial_corr(1)

The expected output is:

tensor(512., device='cuda:0')
tensor(512., device='cuda:1')

However, it returns:

tensor(512., device='cuda:0')
tensor(0., device='cuda:1')

The output is as expected if the device ordinals are the same or everything is executed on the CPU. I run the code with Python 3.7 and PyTorch 1.2.

clang: error: unsupported option '-fopenmp'

Thanks for your valuable work! And I got this error when I find
python setup_cpu.py install on my MacBook pro without Cuda. Does it need Cuda installed when I just want to use it on CPU?(I have installed GCC)

undefined symbol: _ZTIN3c1021Auto

Hey, I got This error when I want to run:
import spatial_correlation_sampler_backend as correlation

"pip install spatial-correlation-sampler", passes. And then, when I import it in python,

from spatial_correlation_sampler import spatial_correlation_sample

lib/python3.6/site-packages/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE

pytorch 1.0.1.post2
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
Cuda compilation tools, release 10.0, V10.0.130

pip install without errors, but module import fails.

Hi

I tried installing with pip first. this worked without errors, but trying to import the package
import spatial_correlation_sampler
gave the error

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/adrian/research/envs/pytorch041/lib/python3.7/site-packages/spatial_correlation_sampler/__init__.py", line 1, in <module> from .spatial_correlation_sampler import SpatialCorrelationSampler, SpatialCorrelationSamplerFunction, spatial_correlation_sample File "/home/adrian/research/envs/pytorch041/lib/python3.7/site-packages/spatial_correlation_sampler/spatial_correlation_sampler.py", line 6, in <module> import spatial_correlation_sampler_backend as correlation ImportError: /home/adrian/research/envs/pytorch041/lib/python3.7/site-packages/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE

My environment was:
cuda 9.0
gcc 5.5
(also tried with cuda9.2/10 and gcc 7.3)
PyTorch 0.4.1
Python 3.7

How I solved it:

First I cloned the repository and tried with the environment above. This did not work and gave the errors:
... cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ Correlation_Module/correlation.cpp:1:29: fatal error: torch/extension.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status

I switched to PyTorch 1.0.1 environment and changed cuda version to 10.0 (and gcc to 7.3) and installed with setup.py again. This finally worked. Not sure why but wanted to share this in case someone else has the same trouble.

@ClementPinard The README says it is expected to compile with 0.4.1, perhaps this info is outdated?

Build error when using pytorch 1.7

When I upgraded to a RTX 3090 graphics card, I had to use cuda11 and the latest official version of PyTorch 1.7.

System Info:
I9 9900K
RTX3090
NVIDIA-Linux-x86_64-455.23.04.run
cuda_11.1.1_455.32.00_linux.run
cudnn-11.1-linux-x64-v8.0.4.30.tgz
Python 3.8 (Anaconda3-2020.07-Linux-x86_64.sh)
Pytorch 1.7

The following error (is too long, there is only the last part) occurred while reinstalling this library from pip:

pip install spatial_correlation_sampler==0.3.0
....
/tmp/tmpxft_00004720_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:55:0: error: expected ‘)’ before ‘float’
    tmpxft_00004720_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:1:28: error: reference to ‘_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e’ is ambiguous
    Correlation_Module/correlation_cuda_kernel.cu:20:11: note: candidates are: namespace _GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e { }
     namespace {
               ^
    /home1/user/anaconda3/lib/python3.8/site-packages/torch/include/ATen/Functions.h:1518:11: note:                 namespace at::_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e { }
     namespace {
               ^
    In file included from /tmp/tmpxft_00004720_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:8:0,
                     from tmpxft_00004720_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:1:
    /tmp/tmpxft_00004720_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:55:0: error: expected primary-expression before ‘double’
     static void __nv_cudaEntityRegisterCallback(void **__T672){__nv_dummy_param_ref(__T672);__nv_save_fatbinhandle_for_managed_rt(__T672);__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIN3c104HalfELm5ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIN3c104HalfELm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIN3c104HalfELm4ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input2< ::c10::Half> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e39correlation_cuda_backward_kernel_input2IN3c104HalfEEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS3_17RestrictPtrTraitsEiEENS4_IS5_Lm4ES6_iEES8_iiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIN3c104HalfELm5ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIN3c104HalfELm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIN3c104HalfELm4ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input1< ::c10::Half> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e39correlation_cuda_backward_kernel_input1IN3c104HalfEEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS3_17RestrictPtrTraitsEiEENS4_IS5_Lm4ES6_iEES8_iiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIfLm5ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIfLm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIfLm4ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input2<float> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e39correlation_cuda_backward_kernel_input2IfEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIfLm5ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIfLm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIfLm4ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input1<float> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e39correlation_cuda_backward_kernel_input1IfEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIdLm5ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIdLm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIdLm4ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input2<double> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e39correlation_cuda_backward_kernel_input2IdEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIdLm5ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIdLm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIdLm4ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input1<double> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e39correlation_cuda_backward_kernel_input1IdEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIN3c104HalfELm4ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIN3c104HalfELm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIN3c104HalfELm5ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_forward_kernel< ::c10::Half> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e31correlation_cuda_forward_kernelIN3c104HalfEEEvN2at27GenericPackedTensorAccessorIT_Lm4ENS3_17RestrictPtrTraitsEiEES7_NS4_IS5_Lm5ES6_iEEiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIfLm4ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIfLm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIfLm5ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_forward_kernel<float> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e31correlation_cuda_forward_kernelIfEEvN2at27GenericPackedTensorAccessorIT_Lm4ENS1_17RestrictPtrTraitsEiEES5_NS2_IS3_Lm5ES4_iEEiiiiiiiiii, (-1));__cudaRegisterEntry(__T672, ((void ( *)(const _ZN2at20PackedTensorAccessorIdLm4ENS_17RestrictPtrTraitsEiEE, const _ZN2at20PackedTensorAccessorIdLm4ENS_17RestrictPtrTraitsEiEE, _ZN2at20PackedTensorAccessorIdLm5ENS_17RestrictPtrTraitsEiEE, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_forward_kernel<double> ), _ZN82_GLOBAL__N__58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e31correlation_cuda_forward_kernelIdEEvN2at27GenericPackedTensorAccessorIT_Lm4ENS1_17RestrictPtrTraitsEiEES5_NS2_IS3_Lm5ES4_iEEiiiiiiiiii, (-1));__cudaRegisterVariable(__T672, __shadow_var(_ZN80_INTERNAL_58_tmpxft_00004720_00000000_7_correlation_cuda_kernel_cpp1_ii_90c2133e6thrust6system6detail10sequential3seqE,::thrust::system::detail::sequential::seq), 0, 1UL, 0, 0);}
/tmp/tmpxft_00004720_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:55:0: error: expected ‘)’ before ‘double’
    error: command '/usr/local/cuda-11.1/bin/nvcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home1/user/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ytagkuw8/spatial-correlation-sampler/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ytagkuw8/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-41m2pf99/install-record.txt --single-version-externally-managed --compile --install-headers /home1/user/anaconda3/include/python3.8/spatial-correlation-sampler Check the logs for full command output.

I also tested installing 0.2.1 and 0.2.0 using pip and returned the same error.

In addition, I try to install through source code compilation following the README.

python setup.py install
/tmp/tmpxft_00003dbc_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:55:0: error: expected ‘)’ before ‘float’
tmpxft_00003dbc_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:1:28: error: reference to ‘_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c’ is ambiguous
Correlation_Module/correlation_cuda_kernel.cu:20:11: note: candidates are: namespace _GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c { }
 namespace {
           ^                                                                                 
/home1/user/anaconda3/lib/python3.8/site-packages/torch/include/ATen/Functions.h:1518:11: note:                 namespace at::_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c { }
 namespace {
           ^                                                                                 
In file included from /tmp/tmpxft_00003dbc_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:8:0,
                 from tmpxft_00003dbc_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:1:
/tmp/tmpxft_00003dbc_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:55:0: error: expected primary-expression before ‘double’
 static void __nv_cudaEntityRegisterCallback(void **__T684){__nv_dummy_param_ref(__T684);__nv_save_fatbinhandle_for_managed_rt(__T684);__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IN3c104HalfELm5ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IN3c104HalfELm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IN3c104HalfELm4ENS_17RestrictPtrTraitsEEE, int, int, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input2< ::c10::Half> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c39correlation_cuda_backward_kernel_input2IN3c104HalfEEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS3_17RestrictPtrTraitsEiEENS4_IS5_Lm4ES6_iEES8_iiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IN3c104HalfELm5ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IN3c104HalfELm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IN3c104HalfELm4ENS_17RestrictPtrTraitsEEE, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input1< ::c10::Half> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c39correlation_cuda_backward_kernel_input1IN3c104HalfEEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS3_17RestrictPtrTraitsEiEENS4_IS5_Lm4ES6_iEES8_iiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IfLm5ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IfLm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IfLm4ENS_17RestrictPtrTraitsEEE, int, int, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input2<float> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c39correlation_cuda_backward_kernel_input2IfEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IfLm5ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IfLm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IfLm4ENS_17RestrictPtrTraitsEEE, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input1<float> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c39correlation_cuda_backward_kernel_input1IfEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IdLm5ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IdLm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IdLm4ENS_17RestrictPtrTraitsEEE, int, int, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input2<double> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c39correlation_cuda_backward_kernel_input2IdEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IdLm5ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IdLm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IdLm4ENS_17RestrictPtrTraitsEEE, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int, const int))_NV_ANON_NAMESPACE::correlation_cuda_backward_kernel_input1<double> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c39correlation_cuda_backward_kernel_input1IdEEvN2at27GenericPackedTensorAccessorIT_Lm5ENS1_17RestrictPtrTraitsEiEENS2_IS3_Lm4ES4_iEES6_iiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IN3c104HalfELm4ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IN3c104HalfELm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IN3c104HalfELm5ENS_17RestrictPtrTraitsEEE, int, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_forward_kernel< ::c10::Half> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c31correlation_cuda_forward_kernelIN3c104HalfEEEvN2at27GenericPackedTensorAccessorIT_Lm4ENS3_17RestrictPtrTraitsEiEES7_NS4_IS5_Lm5ES6_iEEiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IfLm4ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IfLm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IfLm5ENS_17RestrictPtrTraitsEEE, int, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_forward_kernel<float> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c31correlation_cuda_forward_kernelIfEEvN2at27GenericPackedTensorAccessorIT_Lm4ENS1_17RestrictPtrTraitsEiEES5_NS2_IS3_Lm5ES4_iEEiiiiiiiiiiii, (-1));__cudaRegisterEntry(__T684, ((void ( *)(const _ZN2at22PackedTensorAccessor32IdLm4ENS_17RestrictPtrTraitsEEE, const _ZN2at22PackedTensorAccessor32IdLm4ENS_17RestrictPtrTraitsEEE, _ZN2at22PackedTensorAccessor32IdLm5ENS_17RestrictPtrTraitsEEE, int, int, int, int, int, int, int, int, int, int, int, int))_NV_ANON_NAMESPACE::correlation_cuda_forward_kernel<double> ), _ZN82_GLOBAL__N__58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c31correlation_cuda_forward_kernelIdEEvN2at27GenericPackedTensorAccessorIT_Lm4ENS1_17RestrictPtrTraitsEiEES5_NS2_IS3_Lm5ES4_iEEiiiiiiiiiiii, (-1));__cudaRegisterVariable(__T684, __shadow_var(_ZN80_INTERNAL_58_tmpxft_00003dbc_00000000_7_correlation_cuda_kernel_cpp1_ii_04f3d18c6thrust6system6detail10sequential3seqE,::thrust::system::detail::sequential::seq), 0, 1UL, 0, 0);}
 
/tmp/tmpxft_00003dbc_00000000-6_correlation_cuda_kernel.cudafe1.stub.c:55:0: error: expected ‘)’ before ‘double’
error: command '/usr/local/cuda-11.1/bin/nvcc' failed with exit status 1

It looks like the same error as pip.

In order to determine where the problem is, I tried to install Pytorch 1.7 on a 2080ti computer, and the same error occurred when compiling this library. It uses cuda10.0 and python 3.8. However, using Pytorch 1.6 can install this library normally. My guess is that this error was introduced in the latest version of Pytorch 1.7.

I hope I can get your help, Thanks!

I installed the version 0.0.8 successfully, but got an import error.

I use the following command to install the package.
pip install spatial-correlation-sampler==0.0.8
And got the success message:
Processing ./.cache/pip/wheels/38/3b/a9/f9d27368124ec8ef31c510fdfd7e36739daa191f1015230a7d/spatial_correlation_sampler-0.0.8-cp37-cp37m-linux_x86_64.whl Requirement already satisfied: torch>=0.4.1 in ./anaconda3/envs/corrflow/lib/python3.7/site-packages (from spatial-correlation-sampler==0.0.8) (1.1.0) Requirement already satisfied: numpy in ./anaconda3/envs/corrflow/lib/python3.7/site-packages (from spatial-correlation-sampler==0.0.8) (1.17.5) Installing collected packages: spatial-correlation-sampler Successfully installed spatial-correlation-sampler-0.0.8

But when I try to import the package, I got the following error.

import torch
import spatial_correlation_sampler
Traceback (most recent call last):
File "", line 1, in
File "/remote-home/zhufangrui18210980021/anaconda3/envs/corrflow/lib/python3.7/site-packages/spatial_correlation_sampler/init.py", line 1, in
from .spatial_correlation_sampler import SpatialCorrelationSampler, SpatialCorrelationSamplerFunction, spatial_correlation_sample
File "/remote-home/zhufangrui18210980021/anaconda3/envs/corrflow/lib/python3.7/site-packages/spatial_correlation_sampler/spatial_correlation_sampler.py", line 6, in
import spatial_correlation_sampler_backend as correlation
ImportError: /remote-home/zhufangrui18210980021/anaconda3/envs/corrflow/lib/python3.7/site-packages/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __cudaRegisterFatBinaryEnd

My environment settings are:

  • gcc: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
  • torch: 1.1.0
  • CUDA: 9.0, V9.0.176
  • python: 3.7

Could anyone help me to check what's wrong with it?
Thank you !!!

cant installspatial-correlation-sampler

I'm sorry to have bothered you
I first downloaded your code package:Pytorch Correlation- Extension,
Unzip it and place it in the Lib -Sitepackages directory under the Python path
Enter Python setup.py install after the corresponding path under the CMD window
The following is my error report. I tried many ways but still couldn't install it
python3.7 torch1.6 cuda 10.2 gcc9.3
##############
C:\Python38\Lib\site-packages\Pytorch-Correlation-extension>python setup.py install
running install
running bdist_egg
running egg_info
creating Correlation_Module\spatial_correlation_sampler.egg-info
writing Correlation_Module\spatial_correlation_sampler.egg-info\PKG-INFO
writing dependency_links to Correlation_Module\spatial_correlation_sampler.egg-info\dependency_links.txt
writing requirements to Correlation_Module\spatial_correlation_sampler.egg-info\requires.txt
writing top-level names to Correlation_Module\spatial_correlation_sampler.egg-info\top_level.txt
writing manifest file 'Correlation_Module\spatial_correlation_sampler.egg-info\SOURCES.txt'
reading manifest file 'Correlation_Module\spatial_correlation_sampler.egg-info\SOURCES.txt'
writing manifest file 'Correlation_Module\spatial_correlation_sampler.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler\spatial_correlation_sampler.py -> build\lib.win-amd64-3.7\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler_init_.py -> build\lib.win-amd64-3.7\spatial_correlation_sampler
running build_ext
D:\workshop\lib\site-packages\torch\utils\cpp_extension.py:270: UserWarning: Error checking compiler version for cl: Command 'cl' returned non-zero exit status 1.
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'spatial_correlation_sampler_backend' extension
creating C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7
creating C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release
creating C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release\Correlation_ModuleEmitting ninja build file C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/3] cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DUSE_CUDA -ID:\workshop\lib\site-packages\torch\include -ID:\workshop\lib\site-packages\torch\include\torch\csrc\api\include -ID:\workshop\lib\site-packages\torch\include\TH -ID:\workshop\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -ID:\workshop\include -ID:\workshop\include -c C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\Correlation_Module\correlation.cpp /FoC:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release\Correlation_Module\correlation.obj -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Python38/Lib/site-packages/Pytorch-Correlation-extension/build/temp.win-amd64-3.7/Release/Correlation_Module/correlation.obj
cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DUSE_CUDA -ID:\workshop\lib\site-packages\torch\include -ID:\workshop\lib\site-packages\torch\include\torch\csrc\api\include -ID:\workshop\lib\site-packages\torch\include\TH -ID:\workshop\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -ID:\workshop\include -ID:\workshop\include -c C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\Correlation_Module\correlation.cpp /FoC:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release\Correlation_Module\correlation.obj -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
CreateProcess failed: The system cannot find the file specified.
[2/3] cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DUSE_CUDA -ID:\workshop\lib\site-packages\torch\include -ID:\workshop\lib\site-packages\torch\include\torch\csrc\api\include -ID:\workshop\lib\site-packages\torch\include\TH -ID:\workshop\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -ID:\workshop\include -ID:\workshop\include -c C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\Correlation_Module\correlation_sampler.cpp /FoC:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release\Correlation_Module\correlation_sampler.obj -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Python38/Lib/site-packages/Pytorch-Correlation-extension/build/temp.win-amd64-3.7/Release/Correlation_Module/correlation_sampler.obj
cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DUSE_CUDA -ID:\workshop\lib\site-packages\torch\include -ID:\workshop\lib\site-packages\torch\include\torch\csrc\api\include -ID:\workshop\lib\site-packages\torch\include\TH -ID:\workshop\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -ID:\workshop\include -ID:\workshop\include -c C:\Python38\Lib\site-packages\Pytorch-Correlation-extension\Correlation_Module\correlation_sampler.cpp /FoC:\Python38\Lib\site-packages\Pytorch-Correlation-extension\build\temp.win-amd64-3.7\Release\Correlation_Module\correlation_sampler.obj -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
CreateProcess failed: The system cannot find the file specified.
ninja: fatal: ReadFile: 句柄无效。

Traceback (most recent call last):
File "D:\workshop\lib\site-packages\torch\utils\cpp_extension.py", line 1515, in _run_ninja_build
env=env)
File "D:\workshop\lib\subprocess.py", line 468, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 57, in
launch_setup()
File "setup.py", line 52, in launch_setup
"Topic :: Scientific/Engineering :: Artificial Intelligence"
File "D:\workshop\lib\site-packages\setuptools_init_.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\workshop\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\workshop\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\workshop\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\workshop\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "D:\workshop\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "D:\workshop\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\workshop\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\workshop\lib\site-packages\setuptools\command\bdist_egg.py", line 174, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "D:\workshop\lib\site-packages\setuptools\command\bdist_egg.py", line 160, in call_command
self.run_command(cmdname)
File "D:\workshop\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\workshop\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\workshop\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "D:\workshop\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "D:\workshop\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\workshop\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\workshop\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "D:\workshop\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "D:\workshop\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "D:\workshop\lib\site-packages\torch\utils\cpp_extension.py", line 649, in build_extensions
build_ext.build_extensions(self)
File "D:\workshop\lib\site-packages\Cython\Distutils\old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "D:\workshop\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension
_build_ext.build_extension(self, ext)
File "D:\workshop\lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "D:\workshop\lib\site-packages\torch\utils\cpp_extension.py", line 631, in win_wrap_ninja_compile
with_cuda=with_cuda)
File "D:\workshop\lib\site-packages\torch\utils\cpp_extension.py", line 1233, in _write_ninja_file_and_compile_objects error_prefix='Error compiling objects for extension')
File "D:\workshop\lib\site-packages\torch\utils\cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension
#####################

How to install on Mac CPU

I found #11 and I had the same problem. Following suggestions there I made the following changes but with no luck:

  • Removed .cu file from sources and changed CUDAExtension to CppExtension in setup.py (see attached setup.py.txt)
  • I had openmp installed
  • I built the wheel using CXX=clang++ CC=clang python3 setup.py build

The output is:

running build
running build_py
running build_ext
building 'spatial_correlation_sampler_backend' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I$VIRTUAL_ENV/lib/python3.6/site-packages/torch/include -I$VIRTUAL_ENV/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I$VIRTUAL_ENV/lib/python3.6/site-packages/torch/include/TH -I$VIRTUAL_ENV/lib/python3.6/site-packages/torch/include/THC -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c Correlation_Module/correlation.cpp -o build/temp.macosx-10.9-x86_64-3.6/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
clang: error: unsupported option '-fopenmp'
error: command 'clang' failed with exit status 1

Thanks for help!

setup.py.txt

Tf implementation

HI,

Would you be knowing of any easy to use ( like this one) , correlation layer in tensorflow.

Backward computation logic

Hi Clement, thank you for this repository, it is very helpful.

I am trying to modify it a bit to adapt to my task and I am struggling with the backward implementation. Could you please explain why the indexing logic is so different between the forward and backward pass?

More specifically, could you answer these questions?

  1. why do we use only the thread index in the forward pass and two indices, namely ph_off and pw_off in the backward pass?
  2. why THREADS_FORWARD is 32 and THREADS_BACKWARD is 5?

Thank you!

Illegal memory access occurs when use nn.AvgPool2d

System env
Two nodes, both have same environment and hardware
Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-131-generic x86_64)
pytorch 1.1.0
2*RTX TITAN 24GB
Cuda compilation tools, release 10.0, V10.0.130
Python 3.6.5
[GCC 5.4.0 20160609] on linux

Code
These codes can make illegal memory access reappear.

import torch.nn as nn
import torch
def make_conv(in_dim, out_dim, kernel_size=(3, 3), stride=1,
              padding=1, activation=None, norm_type=''):
    layer = []
    if norm_type == 'SN':
        layer += [nn.utils.spectral_norm(nn.Conv2d(in_dim, out_dim, kernel_size, stride, padding))]
    elif norm_type in ('BN', 'synBN'):
        layer += [nn.Conv2d(in_dim, out_dim, kernel_size, stride, padding),
                  nn.BatchNorm2d(out_dim, momentum=0.8, eps=1e-3)]
    elif norm_type == 'IN':
        layer += [nn.Conv2d(in_dim, out_dim, kernel_size, stride, padding),
                  nn.InstanceNorm2d(out_dim, affine=False, track_running_stats=False)]
    else:
        layer += [nn.Conv2d(in_dim, out_dim, kernel_size, stride, padding)]
    if activation is not None:
        layer += [activation]
    return nn.Sequential(*layer)
class AdShuffleGenerator(nn.Module):
    def __init__(self, n1=64, n2=64, n3=64, f1=1, f2=4, f3=1, n_rn=9, updown_conv=-1, activation='prelu',
                 activation_final='tanh', norm_type='SN', senet=False):
        super().__init__()
        blur_upsample_flag = False
        if updown_conv < 0:
            updown_conv = int(-updown_conv)
            blur_upsample_flag = True
        if activation == 'selu':
            self.activation = nn.SELU()
        elif activation == 'prelu':
            self.activation = nn.PReLU()
        else:
            self.activation = nn.ReLU()
        if activation_final == 'tanh':
            self.activation_final = nn.Tanh()
        elif activation_final == 'prelu':
            self.activation_final = nn.PReLU()
        elif activation_final == 'sigmoid':
            self.activation_final = nn.Sigmoid()
        else:
            self.activation_final = None
        k1_padding = int(f1 / 2) if f1 % 2 and f1 > 1 else 0
        k3_padding = int(f3 / 2) if f3 % 2 and f3 > 1 else 0
        self.layer0 = make_conv(3, n1, kernel_size=f1, padding=k1_padding, activation=self.activation,
                                norm_type=norm_type)
        layer_down = []
        for i in range(0, updown_conv):
            layer_down += [make_conv(n1, n2, kernel_size=f2, stride=2, activation=self.activation, norm_type=norm_type)]
        self.layer_down = nn.Sequential(*layer_down)
        layer_up = []
        for i in range(0, updown_conv):
            layer_up += [make_conv(n2, n2 * 4, activation=self.activation, norm_type=norm_type), nn.PixelShuffle(2)]
            if blur_upsample_flag:
                layer_up += [nn.ReplicationPad2d((1, 0, 1, 0)), nn.AvgPool2d(2, stride=1)]
        self.layer_up = nn.Sequential(*layer_up)
        self.final_layer = nn.Conv2d(n2, 3, kernel_size=f3, padding=k3_padding)
    def forward(self, x):
        x = self.layer0(x)
        x = self.layer_down(x)
        x = self.layer_up(x)
        x = self.final_layer(x)
        if self.activation_final is not None:
            x = self.activation_final(x)
        return x
net = AdShuffleGenerator().cuda()
a = torch.rand(1,3, 5761, 3841).cuda()
with torch.no_grad():
    y_pred = net.layer0(a)
    y_pred = net.layer_down(y_pred)
    y_pred = net.layer_up[0](y_pred)
    y_pred = net.layer_up[1](y_pred)
    y_pred = net.layer_up[2](y_pred)
print(y_pred.max())
torch.cuda.empty_cache()
with torch.no_grad():
    y_pred = net.layer_up[3](y_pred)
print(y_pred.max())

CUDA_LAUNCH_BLOCKING=1 Command line Error

  File "/home/athena-test/Athena/cnn_models/torch_distributed.py", line 660, in forward
    x = self.layer_up(x)
  File "/usr/local/python3.6.5/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/python3.6.5/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
    input = module(input)
  File "/usr/local/python3.6.5/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/python3.6.5/lib/python3.6/site-packages/torch/nn/modules/pooling.py", line 563, in forward
    self.padding, self.ceil_mode, self.count_include_pad)
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /pytorch/aten/src/THCUNN/generic/SpatialAveragePooling.cu:112

Installation Error

hi,

I met the same error while installing from pip and from source code.
My environment specs: cuda/9.0 gcc-5.4.0 torch 1.0.1 python 3.6.6

And the first several lines of the error message are:

/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:206: error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:215: error: template argument 1 is invalid
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:392: error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:395: error: template argument 2 is invalid
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:397: error: template argument 1 is invalid
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:397: error: template argument 2 is invalid
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:412: error: template argument 1 is invalid
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:149: error: expansion pattern ‘std::is_copy_constructible<_Tp>::value’ contains no argument packs
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:240: error: expansion pattern ‘std::is_same<typename Container::value_type&, typename Container::reference>::value’ contains no argument packs
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:249: error: template argument 1 is invalid
/home/ww/.local/lib/python3.6/site-packages/torch/lib/include/pybind11/cast.h:766:249: error: template argument 2 is invalid

pip install error

hi i failed to install

i got this error message

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-QlQ2v1/spatial-correlation-sampler/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-1qIZX1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-QlQ2v1/spatial-correlation-sampler/

i don't even know what this mean please help me

Feature-wise correlation

Hi,
I'm trying to implement feature-wise correlation, required for VCN: Volumetric Correspondence Networks.
The main difference is that feature-wise correlation does not sum over the channel dimension, the output cost volume is therefore (B x C x PatchH x PatchW x oH x oW) instead of (B x PatchH x PatchW x oH x oW).

The forward pass is already implemented here: https://github.com/gengshan-y/Pytorch-Correlation-extension
I'm trying to implement the backward pass, i thought that changing this
prod_sum[ph_off][pw_off] += gradOutput[n][ph][pw][i2][j2] * val;
to this
prod_sum[ph_off][pw_off] += gradOutput[n][c][ph][pw][i2][j2] * val;
would do the job, but it's not working.

I'm testing it with torch.autograd.gradcheck, and the jacobians from analytical and numerical are different (same values, but in different order).

Do you have any idea on how to implement the backward pass?

Hello,can I modify this code to implement my own function?

The original correlation operation was performed in a nearby area.For example,FlowNetC is d=4,so the cost volume is HxWx81,Now I want to change the matching area to a fixed area.This fixed patch's size is hxw,so the cost volume is HxWx(hxw). Can I implement this by modifying this code?
Looking forward to your suggestions

About the batch_size and kernel_size

Hello! Thanks for your valuable work again! I am confused about the batch size and the input1 input2. e.g. input1 = (16, 3, 224, 224) and input2 = (16, 3, 224, 224),is the correlation of input1 and input2: cat_{i=0 => 15}{corr(input1[i, 3, 224, 224], input2[i, 3, 224, 224])}?
And the order of the input1 and input2 is: for a pixel x_{i,j} in input1, compute the patch around the location i, j in the input2. Is that right?
Finally, what is the kernel size meaning? I guess if kernel size = 1, it is: 1 pixel in the input1 => patch in the input2; kernel size=2: 4 pixel in the input1 => patch in the input2. I did not find the detail of flownet-C in Flownet and Flownet2.0 of the kernel size. Thanks for your help!

FlowNet2C training and validation

@ClementPinard Hi, thanks for your great work, I used it when training FlowNet2C. Install is well-done. I use SpatialCorrelationSampler(kernel_size=1, patch_size=21, stride=1, padding=0, dilation=1, dilation_patch=2) to replace the correlation function in the code. But the training loss didn't decrease and the validation EPE is very big. I don't know why, could you please give me some suggestions? Thanks very much.
image

Can I use pytorch==1.1 to install?

Hello,because of my cuda driver is not suit for pytorch1.2, and I can not update the service cuda driver version. So, if I use pytorch1.1, shall I modify some code?
I have test 1.1 version, and there is some unkown error.

Segmentation fault (core dumped) when running `check.py`

Hi, I have successfully installed via pip install spatial-correlation-sampler, but it could not pass the testing when I run python check.py forward. The error message are following:

$ python check.py forward
Forward: CPU vs. CUDA ... Traceback (most recent call last):
File "check.py", line 91, in
check_forward(input1, input2, correlation_sampler, args.verbose)
File "check.py", line 35, in check_forward
check_equal(cpu_values, cuda_values, verbose)
File "check.py", line 18, in check_equal
np.testing.assert_allclose(x, y, err_msg="Index: {}".format(i))
File "/home/ysnan/anaconda3/lib/python3.6/site-packages/numpy/testing/utils.py", line 1395, in assert_allclose
verbose=verbose, header=header, equal_nan=equal_nan)
File "/home/ysnan/anaconda3/lib/python3.6/site-packages/numpy/testing/utils.py", line 778, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-07, atol=0
Index: 0
(mismatch 39.64334705075446%)
x: array([[[[ 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00,
0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00,
0.000000e+00],...
y: array([[[[ 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0.],...
Segmentation fault (core dumped)

FYI, my configuration is
gcc=7.4.0
pytorch=1.3.1
cuda=V10.0.130
python=3.6.3

Could you please help me to find out the solution. Thank you!

cant install correlation extension

hi, when install correlation extension, an error occured`Collecting spatial-correlation-sampler==0.2.0
Downloading https://files.pythonhosted.org/packages/0e/81/37a407309ba447a7a710d74aa06bfcfed29f160862d824d76e7cdbae57c7/spatial_correlation_sampler-0.2.0.tar.gz
Requirement already satisfied: torch>=1.1 in /data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages (from spatial-correlation-sampler==0.2.0) (1.1.0)
Requirement already satisfied: numpy in /data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages (from spatial-correlation-sampler==0.2.0) (1.17.3)
Building wheels for collected packages: spatial-correlation-sampler
Building wheel for spatial-correlation-sampler (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /data/ch/anaconda3/envs/THTF/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py'"'"'; file='"'"'/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-m0g5tnqy --python-tag cp36
cwd: /tmp/pip-install-otlptma3/spatial-correlation-sampler/
Complete output (52 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/init.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
running build_ext
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py", line 57, in
launch_setup()
File "/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py", line 52, in launch_setup
"Topic :: Scientific/Engineering :: Artificial Intelligence"
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 232, in build_extensions
self._check_abi()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 370, in _check_abi
check_compiler_abi_compatibility(compiler)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 162, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 138, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', '/path/to/gcc-5.4.0//bin/g++']' returned non-zero exit status 1.

ERROR: Failed building wheel for spatial-correlation-sampler
Running setup.py clean for spatial-correlation-sampler
Failed to build spatial-correlation-sampler
Installing collected packages: spatial-correlation-sampler
Running setup.py install for spatial-correlation-sampler ... error
ERROR: Command errored out with exit status 1:
command: /data/ch/anaconda3/envs/THTF/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py'"'"'; file='"'"'/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-fv2lxtb3/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-otlptma3/spatial-correlation-sampler/
Complete output (54 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
copying Correlation_Module/spatial_correlation_sampler/init.py -> build/lib.linux-x86_64-3.6/spatial_correlation_sampler
running build_ext
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py", line 57, in
launch_setup()
File "/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py", line 52, in launch_setup
"Topic :: Scientific/Engineering :: Artificial Intelligence"
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 232, in build_extensions
self._check_abi()
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 370, in _check_abi
check_compiler_abi_compatibility(compiler)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 162, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 138, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/data/ch/anaconda3/envs/THTF/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', '/path/to/gcc-5.4.0//bin/g++']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /data/ch/anaconda3/envs/THTF/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py'"'"'; file='"'"'/tmp/pip-install-otlptma3/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-fv2lxtb3/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
`
my enviroment is python->3.6
cuda->9.0
gcc->5.0
torch->1.0
i don't know how to handle please help me, Thank you

error installing on Mac

Hi,
when I'm trying to install on Mac,here is the error:raise EnvironmentError('CUDA_HOME environment variable is not set).my pytorch version is 0.4.1,python is 3.6; because pytorch on Mac only support cpu, so I don't need set CUDA_HOME environment may be, any suggestion?

Padding clarification

Hi,

Can you please clarify the padding you do?
Looks like you assume "zero" padding which is equivalent to bounding the indices (in the cuda kernel code).
Is that right?

Thanks!

How can I use this correlation repo to replace nvidia's

In Nvidia correlation file , I use Correlation(pad_size=4, kernel_size=1, max_displacement=4, stride1=1, stride2=1, corr_multiply=1)
So,I use correlation_sampler = SpatialCorrelationSampler( kernel_size=1,patch_size=4,stride=1,padding=0,dilation_patch=1)
Given input size torch.Size([8, 64, 7, 6]),output shape of your correlation_sampler is torch.Size([8, 4, 4, 7, 6]), while NVIDIA's implementation is torch.Size([8, 81, 7, 6]).
Thus, the convert code is:
b, ph, pw, h, w = output.size()
Nvidia_shape = output.view(b, (ph+pw+1)^2, h, w)
Is my approach correct?

Compilation error on Windows

Hello, I'm trying to install this python library on Windows (I know, support is not guaranteed). I'm having a problem related to CUDA, here is the error message:

1 error detected in the compilation of "C:/Users/root/AppData/Local/Temp/tmpxft_0000a540_00000000-10_correlation_cuda_kernel.cpp1.ii".
correlation_cuda_kernel.cu
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin\\nvcc.exe' failed with exit status 1

I don't understand why it keeps trying to use CUDA 10.0. In my path environment variable, the CUDA 9.2 is listed before CUDA 10.0 and my pytorch has been installed with CUDA 9.0 (because it won't install for CUDA 9.2, I don't know if this may cause a problem). I've read in other discussions that the CUDA version must be compatible with the gcc version, but I don't know mine and I don't know how to find it.

What should I do?

How to use it in DispNet?

good job!
but how can I use it in dispnet? which only consider the disparity in the single axis.

Best and thanks.

WITHIN_BOUNDS x/y bug

I noticed a discrepancy between the cpu and gpu code:
correlation.cpp says:
WITHIN_BOUNDS(x, y, H, W) (x >= 0 && x < W && y >= 0 && y < H)
correlation_cuda_kernel.cu says:
WITHIN_BOUNDS(x, y, H, W) (x >= 0 && x < H && y >= 0 && y < W)
I think this is a bug but maybe it does not affect anything.

Windows support?

Hello,

I'd love to run FlowNet2 on my Windows machine. I tried pip install spatial-correlation-sampler, It gives me an extensive error message which ends:

c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\crt/host_config.h(133): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!
    correlation_cuda_kernel.cu
    error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin\\nvcc.exe' failed with exit status 2

Can't install through pip after update to 0.3

Hey @ClementPinard!

Starting yesterday after the update to the codebase, I stopped being able to install this on my system with specs:

Ubuntu 18.04
CUDA 10.0
gcc 7.4.0

The issue is similar to with an nvcc error in #1

Any ideas? Downgrading back to 0.2.1 works fine.

Error log:

Correlation_Module/correlation_cuda_kernel.cu(23): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(24): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(25): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(88): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(89): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(90): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(161): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(162): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(163): error: PackedTensorAccessor32 is not a template

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "PackedTensorAccessor32" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "trInput1_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "trInput2_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "output_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "PackedTensorAccessor32" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "trInput1_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "trInput2_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "output_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "PackedTensorAccessor32" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "trInput1_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "trInput2_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: identifier "output_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(262): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(262): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(262): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(262): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(297): error: identifier "PackedTensorAccessor32" is undefined

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: identifier "input1_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(297): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: identifier "input2_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(297): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: identifier "gradInput1_acc" is undefined

Correlation_Module/correlation_cuda_kernel.cu(297): error: class "at::Tensor" has no member "packed_accessor32"

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: expected an expression

Correlation_Module/correlation_cuda_kernel.cu(297): error: type name is not allowed

Correlation_Module/correlation_cuda_kernel.cu(297): error: argument list for class template "at::RestrictPtrTraits" is missing

Correlation_Module/correlation_cuda_kernel.cu(297): error: identifier "gradInput2_acc" is undefined

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00000441_00000000-6_correlation_cuda_kernel.cpp1.ii".
Compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

3D images

how can this extension work on 3D images?

Building wheel for spatial-correlation-sampler (setup.py) ... error

Hello

I have problem with:

Building wheel for spatial-correlation-sampler (setup.py) ... error

I need whl file for spatial-correlation-sampler package.
I have win 10, python 3.7.3, CUDA 9.2 and GCC 7.4

Please help?

The whole error message:

(base) C:\WINDOWS\system32>pip install spatial-correlation-sampler
Collecting spatial-correlation-sampler
Using cached https://files.pythonhosted.org/packages/a6/d1/aa0a71739ce998f655286d966c0ad7aff765648431c054c34db7d58b811b/spatial_correlation_sampler-0.1.0.tar.gz
Requirement already satisfied: torch>=1.0.1 in c:\anaconda3\lib\site-packages (from spatial-correlation-sampler) (1.1.0)
Requirement already satisfied: numpy in c:\anaconda3\lib\site-packages (from spatial-correlation-sampler) (1.16.2)
Building wheels for collected packages: spatial-correlation-sampler
Building wheel for spatial-correlation-sampler (setup.py) ... error
Complete output from command C:\Anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Boris\AppData\Local\Temp\pip-install-f4ekhfs9\spatial-correlation-sampler\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\Boris\AppData\Local\Temp\pip-wheel-qrk0s874 --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler\spatial_correlation_sampler.py -> build\lib.win-amd64-3.7\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler_init_.py -> build\lib.win-amd64-3.7\spatial_correlation_sampler
running build_ext
building 'spatial_correlation_sampler_backend' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\Correlation_Module
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Anaconda3\lib\site-packages\torch\include -IC:\Anaconda3\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Anaconda3\lib\site-packages\torch\include\TH -IC:\Anaconda3\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -IC:\Anaconda3\include -IC:\Anaconda3\include /EHsc /TpCorrelation_Module\correlation.cpp /Fobuild\temp.win-amd64-3.7\Release\Correlation_Module\correlation.obj -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /MD
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
correlation.cpp
C:\Anaconda3\lib\site-packages\torch\include\torch\csrc\api\include\torch/cuda.h(5): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit status 2


Failed building wheel for spatial-correlation-sampler
Running setup.py clean for spatial-correlation-sampler
Failed to build spatial-correlation-sampler
Installing collected packages: spatial-correlation-sampler
Running setup.py install for spatial-correlation-sampler ... error
Complete output from command C:\Anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Boris\AppData\Local\Temp\pip-install-f4ekhfs9\spatial-correlation-sampler\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Boris\AppData\Local\Temp\pip-record-j38ydtlr\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler\spatial_correlation_sampler.py -> build\lib.win-amd64-3.7\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler_init_.py -> build\lib.win-amd64-3.7\spatial_correlation_sampler
running build_ext
building 'spatial_correlation_sampler_backend' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\Correlation_Module
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Anaconda3\lib\site-packages\torch\include -IC:\Anaconda3\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Anaconda3\lib\site-packages\torch\include\TH -IC:\Anaconda3\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -IC:\Anaconda3\include -IC:\Anaconda3\include /EHsc /TpCorrelation_Module\correlation.cpp /Fobuild\temp.win-amd64-3.7\Release\Correlation_Module\correlation.obj -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /MD
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
correlation.cpp
C:\Anaconda3\lib\site-packages\torch\include\torch\csrc\api\include\torch/cuda.h(5): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit status 2

----------------------------------------

Command "C:\Anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Boris\AppData\Local\Temp\pip-install-f4ekhfs9\spatial-correlation-sampler\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Boris\AppData\Local\Temp\pip-record-j38ydtlr\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Boris\AppData\Local\Temp\pip-install-f4ekhfs9\spatial-correlation-sampler\

(base) C:\WINDOWS\system32>$ conda install -c https://conda.anaconda.org/conda-forge spatial-correlation-sampler
'$' is not recognized as an internal or external command,
operable program or batch file.

(base) C:\WINDOWS\system32>conda install -c https://conda.anaconda.org/conda-forge spatial-correlation-sampler
WARNING conda.base.context:use_only_tar_bz2(632): Conda is constrained to only using the old .tar.bz2 file format because you have conda-build installed, and it is <3.18.3. Update or remove conda-build to get smaller downloads and faster extractions.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • spatial-correlation-sampler

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

(base) C:\WINDOWS\system32>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.