Giter Site home page Giter Site logo

deformable-convolution-v2-pytorch's People

Contributors

akashpalrecha avatar chengdazhi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deformable-convolution-v2-pytorch's Issues

deformable_col2im invalid argument error in pytorch 1.0.0 branch

Hello,

I'm in pytorch_1.0.0 branch

I got the same error in
#13

but in the pytorch_1.0.0 branch, there is no src/deform_conv_cuda_kernel.cu file,
so I searched for GET_BLOCKS
which now exists in src/cuda/deform_im2col_cuda.cuh

after changing this I still get the error.
Unfortunately I'm not familiar with the cuda kernels,
could you help me out?

make.sh problem

when I ran sh make.sh, the problem: raise TypeError ('disc must be a Distribution instance') from build_modulated.py is always showing up, could anyone tell me how to solve it or could u send me processed files?
Thanks

error in modulated_deformable_col2im_coord_cuda: CUDA driver version is insufficient for CUDA runtime version

Who can help me
pytorch 1.1.0
cuda 8.0
NVRM version: NVIDIA UNIX x86_64 Kernel Module 396.45

running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/functions
copying functions/init.py -> build/lib.linux-x86_64-3.6/functions
copying functions/deform_conv_func.py -> build/lib.linux-x86_64-3.6/functions
copying functions/deform_psroi_pooling_func.py -> build/lib.linux-x86_64-3.6/functions
copying functions/modulated_deform_conv_func.py -> build/lib.linux-x86_64-3.6/functions
creating build/lib.linux-x86_64-3.6/modules
copying modules/init.py -> build/lib.linux-x86_64-3.6/modules
copying modules/deform_conv.py -> build/lib.linux-x86_64-3.6/modules
copying modules/deform_psroi_pooling.py -> build/lib.linux-x86_64-3.6/modules
copying modules/modulated_deform_conv.py -> build/lib.linux-x86_64-3.6/modules
running build_ext
building 'DCN' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/mnt
creating build/temp.linux-x86_64-3.6/mnt/data-1
creating build/temp.linux-x86_64-3.6/mnt/data-1/data
creating build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai
creating build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0
creating build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src
creating build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu
creating build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda
gcc -pthread -B /home/users/qiuyu.cai/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/vision.cpp -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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/users/qiuyu.cai/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/deform_cpu.cpp -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/deform_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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/users/qiuyu.cai/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/deform_psroi_pooling_cpu.cpp -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/deform_psroi_pooling_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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/users/qiuyu.cai/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/modulated_deform_cpu.cpp -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/modulated_deform_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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-8.0/bin/nvcc -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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).
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(83): warning: calling a constexpr host function("from_bits") from a host device function("lowest") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(84): warning: calling a constexpr host function("from_bits") from a host device function("max") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(85): warning: calling a constexpr host function("from_bits") from a host device function("lower_bound") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(86): warning: calling a constexpr host function("from_bits") from a host device function("upper_bound") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu: In lambda function:
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu:90:120: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated [-Wdeprecated-declarations]
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:47:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu: In lambda function:
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu:219:120: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated [-Wdeprecated-declarations]
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:47:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
/usr/local/cuda-8.0/bin/nvcc -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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).
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(83): warning: calling a constexpr host function("from_bits") from a host device function("lowest") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(84): warning: calling a constexpr host function("from_bits") from a host device function("max") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(85): warning: calling a constexpr host function("from_bits") from a host device function("lower_bound") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(86): warning: calling a constexpr host function("from_bits") from a host device function("upper_bound") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu: In lambda function:
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu:317:120: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated [-Wdeprecated-declarations]
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:47:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu: In lambda function:
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu:391:126: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated [-Wdeprecated-declarations]
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:47:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
/usr/local/cuda-8.0/bin/nvcc -DWITH_CUDA -I/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/users/qiuyu.cai/anaconda3/include/python3.6m -c /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.cu -o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=DCN -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).
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(83): warning: calling a constexpr host function("from_bits") from a host device function("lowest") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(84): warning: calling a constexpr host function("from_bits") from a host device function("max") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(85): warning: calling a constexpr host function("from_bits") from a host device function("lower_bound") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/NumericLimits.cuh(86): warning: calling a constexpr host function("from_bits") from a host device function("upper_bound") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.cu: In lambda function:
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.cu:93:120: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated [-Wdeprecated-declarations]
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:47:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.cu: In lambda function:
/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.cu:224:120: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated [-Wdeprecated-declarations]
/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:47:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
g++ -pthread -shared -B /home/users/qiuyu.cai/anaconda3/compiler_compat -L/home/users/qiuyu.cai/anaconda3/lib -Wl,-rpath=/home/users/qiuyu.cai/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/vision.o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/deform_cpu.o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/deform_psroi_pooling_cpu.o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cpu/modulated_deform_cpu.o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.o build/temp.linux-x86_64-3.6/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/modulated_deform_conv_cuda.o -L/usr/local/cuda-8.0/lib64 -lcudart -o build/lib.linux-x86_64-3.6/DCN.cpython-36m-x86_64-linux-gnu.so
running install
running bdist_egg
running egg_info
creating DCN.egg-info
writing DCN.egg-info/PKG-INFO
writing dependency_links to DCN.egg-info/dependency_links.txt
writing top-level names to DCN.egg-info/top_level.txt
writing manifest file 'DCN.egg-info/SOURCES.txt'
reading manifest file 'DCN.egg-info/SOURCES.txt'
writing manifest file 'DCN.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/functions
copying build/lib.linux-x86_64-3.6/functions/init.py -> build/bdist.linux-x86_64/egg/functions
copying build/lib.linux-x86_64-3.6/functions/deform_conv_func.py -> build/bdist.linux-x86_64/egg/functions
copying build/lib.linux-x86_64-3.6/functions/deform_psroi_pooling_func.py -> build/bdist.linux-x86_64/egg/functions
copying build/lib.linux-x86_64-3.6/functions/modulated_deform_conv_func.py -> build/bdist.linux-x86_64/egg/functions
creating build/bdist.linux-x86_64/egg/modules
copying build/lib.linux-x86_64-3.6/modules/init.py -> build/bdist.linux-x86_64/egg/modules
copying build/lib.linux-x86_64-3.6/modules/deform_conv.py -> build/bdist.linux-x86_64/egg/modules
copying build/lib.linux-x86_64-3.6/modules/deform_psroi_pooling.py -> build/bdist.linux-x86_64/egg/modules
copying build/lib.linux-x86_64-3.6/modules/modulated_deform_conv.py -> build/bdist.linux-x86_64/egg/modules
copying build/lib.linux-x86_64-3.6/DCN.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
byte-compiling build/bdist.linux-x86_64/egg/functions/init.py to init.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/functions/deform_conv_func.py to deform_conv_func.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/functions/deform_psroi_pooling_func.py to deform_psroi_pooling_func.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/functions/modulated_deform_conv_func.py to modulated_deform_conv_func.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/modules/init.py to init.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/modules/deform_conv.py to deform_conv.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/modules/deform_psroi_pooling.py to deform_psroi_pooling.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/modules/modulated_deform_conv.py to modulated_deform_conv.cpython-36.pyc
creating stub loader for DCN.cpython-36m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/DCN.py to DCN.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying DCN.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DCN.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DCN.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DCN.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
pycache.DCN.cpython-36: module references file
creating dist
creating 'dist/DCN-1.0-py3.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing DCN-1.0-py3.6-linux-x86_64.egg
removing '/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg' (and everything under it)
creating /home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg
Extracting DCN-1.0-py3.6-linux-x86_64.egg to /home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages
DCN 1.0 is already the active version in easy-install.pth

Installed /home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg
Processing dependencies for DCN==1.0
Finished processing dependencies for DCN==1.0

[qiuyu.cai@yz-gpu004 Deformable-Convolution-V2-PyTorch-pytorch_1.0.0]$ python test.py
error in deformable_im2col_cuda: CUDA driver version is insufficient for CUDA runtime version
error in deformable_col2im_coord_cuda: CUDA driver version is insufficient for CUDA runtime version
error in deformable_col2im_cuda: CUDA driver version is insufficient for CUDA runtime version
error in deformable_im2col_cuda: CUDA driver version is insufficient for CUDA runtime version
torch.Size([2, 128, 128, 128])
error in modulated_deformable_im2col_cuda: CUDA driver version is insufficient for CUDA runtime version
error in modulated_deformable_col2im_coord_cuda: CUDA driver version is insufficient for CUDA runtime version
error in modulated_deformable_col2im_cuda: CUDA driver version is insufficient for CUDA runtime version
error in modulated_deformable_im2col_cuda: CUDA driver version is insufficient for CUDA runtime version
torch.Size([2, 128, 128, 128])
THCudaCheck FAIL file=/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu line=339 error=35 : CUDA driver version is insufficient for CUDA runtime version
Traceback (most recent call last):
File "test.py", line 607, in
example_dpooling()
File "test.py", line 561, in example_dpooling
out = pooling(input, rois, offset)
File "/home/users/qiuyu.cai/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/modules/deform_psroi_pooling.py", line 46, in forward
self.trans_std)
File "/mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/functions/deform_psroi_pooling_func.py", line 40, in forward
ctx.sample_per_part, ctx.trans_std)
RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at /mnt/data-1/data/qiuyu.cai/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_psroi_pooling_cuda.cu:339

Visualization

Are there any codes to visualize the offset positions?

deform_conv_cuda_kernel.cu(71): error: namespace "std" has no member "min"

Hello
Thanks for your implementation. I am trying to build your code, however I got errors in the beginning of make.

deform_conv_cuda_kernel.cu(71): error: namespace "std" has no member "min"

1 error detected in the compilation of "/tmp/tmpxft_00005005_00000000-6_deform_conv_cuda_kernel.cpp1.ii".
but the building goes further: generating /tmp/tmpxh9mevss/_deform_conv.c
setting the current directory to '/tmp/tmpxh9mevss'
running build_ext
building '_deform_conv' extension
creating home
creating home/miki
creating home/miki/wd
creating home/miki/wd/Deformable-Convolution-V2-PyTorch-master
creating home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/miki/.conda/envs/py36/include/python3.6m -c _deform_conv.c -o ./_deform_conv.o -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/miki/.conda/envs/py36/include/python3.6m -c /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv.c -o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv.o -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/miki/.conda/envs/py36/include/python3.6m -c /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv_cuda.c -o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv_cuda.o -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -shared -B /home/miki/.conda/envs/py36/compiler_compat -L/home/miki/.conda/envs/py36/lib -Wl,-rpath=/home/miki/.conda/envs/py36/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_deform_conv.o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv.o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv_cuda.o /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv_cuda_kernel.cu.so -o ./_deform_conv.so
gcc: error: /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/deform_conv_cuda_kernel.cu.so: No such file or directory
Traceback (most recent call last):
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/unixccompiler.py", line 197, in link
self.spawn(linker + ld_args)
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

**During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')**
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
target_lang=language)
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
File "/home/miki/.conda/envs/py36/lib/python3.6/distutils/unixccompiler.py", line 199, in link
raise LinkError(msg)
distutils.errors.LinkError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build.py", line 36, in
ffi.build()
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/miki/.conda/envs/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1
Including CUDA code.
/home/miki/wd/Deformable-Convolution-V2-PyTorch-master
generating /tmp/tmp3tjxf2n0/_modulated_dcn.c
setting the current directory to '/tmp/tmp3tjxf2n0'
running build_ext
building '_modulated_dcn' extension
creating home
creating home/miki
creating home/miki/wd
creating home/miki/wd/Deformable-Convolution-V2-PyTorch-master
creating home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src
gcc -pthread -B /home/miki/.conda/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/miki/.conda/envs/py36/include/python3.6m -c _modulated_dcn.c -o ./_modulated_dcn.o -fopenmp -std=c99
gcc -pthread -B /home/miki/.conda/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/miki/.conda/envs/py36/include/python3.6m -c /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/modulated_dcn.c -o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/modulated_dcn.o -fopenmp -std=c99
gcc -pthread -B /home/miki/.conda/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/miki/.conda/envs/py36/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/miki/.conda/envs/py36/include/python3.6m -c /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/modulated_dcn_cuda.c -o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/modulated_dcn_cuda.o -fopenmp -std=c99
gcc -pthread -shared -B /home/miki/.conda/envs/py36/compiler_compat -L/home/miki/.conda/envs/py36/lib -Wl,-rpath=/home/miki/.conda/envs/py36/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_modulated_dcn.o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/modulated_dcn.o ./home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/modulated_dcn_cuda.o /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/cuda/modulated_deform_im2col_cuda.cu.so /home/miki/wd/Deformable-Convolution-V2-PyTorch-master/src/cuda/deform_psroi_pooling_cuda.cu.so -o ./_modulated_dcn.so

as I mentioned the building continues and then I tried the test.py and test_modulated.py and I got the error for:
No module named '_ext.deform_conv._deform_conv'
I appriciate your guide. Thanks

training on multiple GPU

When I tried to train a model on multiple GPUs using nn.DataParallel, I met the error 'Running time error: argument are located on different GPUs', the error was located to deform_conv_func.py, line 34, in the function DCN.deform_conv_forword. When I run the code on a single GPU or without the deformable convolution, the error disappeared. My PyTorch version is 1.0

Pytorch1.0.0 Implementation

from torch.utils.ffi import create_extension
Traceback (most recent call last):
File "", line 1, in
File "/home/local/anaconda/envs/pytorch_py3/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

It seems the implementation is not supported by Pytorch1.0.0.
What should I do to let it support?

Question about the shape of `output_buffer` and `gradOutputBuffer`

Hi,

Recently, I was reading the C++ source code of Deformable Conv. While I met a question about the shape of output_buffer and gradOutputBuffer in the DCN C++ source code. Here is the source code.

THCudaTensor_resize4d(state, output_buffer, batchSize / im2col_step, nOutputPlane, im2col_step * outputHeight, outputWidth);

THCudaTensor_resize4d(state, gradOutputBuffer, batchSize / im2col_step, nOutputPlane, im2col_step * outputHeight, outputWidth);

Why the shape of output_buffer is transformed into batchSize / im2col_step, nOutputPlane, im2col_step * outputHeight, outputWidth instead of batchSize / im2col_step, nOutputPlane, im2col_step, outputHeight, outputWidth? Similar question for the shape of gradOutputBuffer.

Can anyone leave some ideas about that? Thanks a lot!

Solution about `ImportError: undefined symbol`

I download the code and successfully compile it, I can run the test.py file, and pass almost every test but with a small mistake(according to the annotations, it's not a big deal).
When I try to import DCN and use the module in my code, the error occurs:

ImportError:~/anaconda3/lib/python3.7/site-packages/DCN-1.0-py3.7-linux-x86_64.egg/DCN.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE

The DCN package was installed in my site-packages, it's really strange that when I import another package before import DCN, this problem solved! 😳 How STRANGE it is!

from torch.autograd.function import once_differentiable
import DCN

ModuleNotFoundError: No module named 'mmdet.ops.dcn._ext.deform_conv._deform_conv'

Hi, I have a strange problem. Can you help me?
In my PC, after 1) sh compile.sh; 2) python setup.py install; 3) sh make.sh, I can run the code (Deformable-Convolution-V2-PyTorch-mmdetection), but in the other PC I had the problem:
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/init.py", line 4, in
from .dcn import ModulatedDeformConv, ModulatedDeformRoIPoolingPack, DeformConv
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/dcn/init.py", line 1, in
from .modules.deform_conv import DeformConv
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/dcn/modules/init.py", line 1, in
from .deform_conv import DeformConv
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/dcn/modules/deform_conv.py", line 7, in
from ..functions import deform_conv_function
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/dcn/functions/init.py", line 1, in
from .deform_conv import DeformConvFunction, deform_conv_function
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/dcn/functions/deform_conv.py", line 5, in
from .._ext import deform_conv
File "/home/www/anaconda3/envs/xxd36/lib/python3.6/site-packages/mmdet-0.5.4+cd35200-py3.6.egg/mmdet/ops/dcn/_ext/deform_conv/init.py", line 3, in
from ._deform_conv import lib as _lib, ffi as _ffi
ModuleNotFoundError: No module named 'mmdet.ops.dcn._ext.deform_conv._deform_conv'

Looking forward to your reply!

Question about the gradient of Weight

As the shape of gradWeight is [nOutputPlane, nInputPlane, kH, kW] , when using the im2col_step for mini-batch, in the backward for parameters, it seems like the gradWeight is calculated for batchSize/im2col_step times and the final value of gradWeight just depends on the last time?(if batchSize/im2col_step > 1), is it a problem?

THCudaTensor_data(state, gradWeight), n);

Thanks for your help if there is something wrong in my understanding!

_ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E

Traceback (most recent call last):
File "demo.py", line 136, in
demo()
File "demo.py", line 82, in demo
from models.yolov3_baseline import YOLOv3
File "/asff/models/yolov3_baseline.py", line 5, in
from .network_blocks import *
File "/asff/models/network_blocks.py", line 5, in
from utils.DCN.modules.deform_conv2d import DeformConv2d
File "/asff/utils/DCN/modules/init.py", line 1, in
from .deform_conv2d import DeformConv2d, _DeformConv2d, DeformConv2dPack, DeformConv2dPackMore
File "/asff/utils/DCN/modules/deform_conv2d.py", line 12, in
from ..functions.deform_conv2d_func import DeformConv2dFunction
File "/asff/utils/DCN/functions/init.py", line 1, in
from .deform_conv2d_func import DeformConv2dFunction
File "/asff/utils/DCN/functions/deform_conv2d_func.py", line 13, in
import DCN
ImportError: /usr/local/lib/python3.6/dist-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E
root@0ad4f68fc474:/asff#

Not supported for apex

I've tried to train model with DCNv2 via apex mix-precision method, but occurred a dtype bug:

"deform_conv_forward_cuda" not implemented for 'Half'

Does it mean that I cannot train model with half precision?
thx

RuntimeError: batch % im2col_step_ == 0 ASSERT FAILED

Environment:

  • python 3.6
  • torch 1.0

Error occurs as follows when the batch_size is 128 or 192 or 256. But when batch_size = 64 is ok.

File "/home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/modules/deform_conv.py", line 62, in forward
    self.im2col_step)
  File "/home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/functions/deform_conv_func.py", line 34, in forward
    ctx.im2col_step)

RuntimeError: batch % im2col_step_ == 0 ASSERT FAILED at /home/gzh/ocr/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu:58, please report a bug to PyTorch. batch(%d) must divide im2col_step(%d)11764 (deform_conv_cuda_forward at /home/gzh/ocr/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu:58)

frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7f49387f4fe1 in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x7f49387f4dfa in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #2: deform_conv_cuda_forward(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, int, int, int, int, int, int, int, int, int, int, int) + 0x909 (0x7f493475a884 in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so)
frame #3: deform_conv_forward(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, int, int, int, int, int, int, int, int, int, int, int) + 0x79 (0x7f493473fb89 in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so)
frame #4: <unknown function> + 0x2dc97 (0x7f493474cc97 in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so)
frame #5: <unknown function> + 0x2dd3e (0x7f493474cd3e in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so)
frame #6: <unknown function> + 0x2a209 (0x7f4934749209 in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so)
<omitting python frames>
frame #14: THPFunction_apply(_object*, _object*) + 0x581 (0x7f4972b264d1 in /home/gzh/SoftWare/tf1.4/anaconda2/envs/python36/lib/python3.6/site-packages/torch/lib/libtorch_python.so)

I found that the im2col_step = 1 by default, it's strange why batch % im2col_step_ != 0 as the bug refers to?

problem about the grad of dcn's weight

I test the grad of dcn by setting mask to 1 and offset to 0, so the result should be the same as nn.Conv2d. But I get a confusing result. The test code is:
from modules.modulated_dcn import ModulatedDeformConv
input = torch.ones([1,1,10,10],dtype=torch.float).cuda()
offset= torch.zeros([1,9*2,10,10],dtype=torch.float).cuda()
mask= torch.ones([1,9,10,10],dtype=torch.float).cuda()

dcn=ModulatedDeformConv(in_channels=1, out_channels=1,
             kernel_size=3, stride=1, padding=1,deformable_groups=1)
dcn=dcn.cuda()
dcn.weight.data[...]=1#
out=dcn(input,offset,mask)
loss=out.sum()
loss.backward()
print(dcn.weight.grad)
cn=nn.Conv2d(1,1,
            kernel_size=3,
            stride=(1, 1),
            padding=(1, 1),
            bias=False)
cn=cn.cuda()
cn.weight.data[...]=1
out=cn(input)
loss=out.sum()
loss.backward()
print(cn.weight.grad)

and the outputs are:
tensor([[[[ 0., 0., 0.],
[ 0., 1., 1.],
[ 0., 1., 1.]]]], device='cuda:0')
tensor([[[[ 81., 90., 81.],
[ 90., 100., 90.],
[ 81., 90., 81.]]]], device='cuda:0')

If there is error in my code?

Don't know why I get unknown error

Hello,
I wanted to compile and test the DCN module.
I'm on the master branch.

with sh make.sh
I got

Including CUDA code.
/home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch
generating /tmp/tmp3y9_gfz9/_deform_conv.c
setting the current directory to '/tmp/tmp3y9_gfz9'
running build_ext
building '_deform_conv' extension
creating home
creating home/ahyun
creating home/ahyun/cvlab
creating home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch
creating home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ahyun/anaconda3/envs/py36torch041/include/python3.6m -c _deform_conv.c -o ./_deform_conv.o -std=c99 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ahyun/anaconda3/envs/py36torch041/include/python3.6m -c /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv.c -o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv.o -std=c99 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ahyun/anaconda3/envs/py36torch041/include/python3.6m -c /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv_cuda.c -o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv_cuda.o -std=c99 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
gcc -pthread -shared -B /home/ahyun/anaconda3/envs/py36torch041/compiler_compat -L/home/ahyun/anaconda3/envs/py36torch041/lib -Wl,-rpath=/home/ahyun/anaconda3/envs/py36torch041/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_deform_conv.o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv.o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv_cuda.o /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/deform_conv_cuda_kernel.cu.so -o ./_deform_conv.so
Including CUDA code.
/home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch
generating /tmp/tmpmgv_sspo/_modulated_dcn.c
setting the current directory to '/tmp/tmpmgv_sspo'
running build_ext
building '_modulated_dcn' extension
creating home
creating home/ahyun
creating home/ahyun/cvlab
creating home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch
creating home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src
gcc -pthread -B /home/ahyun/anaconda3/envs/py36torch041/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ahyun/anaconda3/envs/py36torch041/include/python3.6m -c _modulated_dcn.c -o ./_modulated_dcn.o -std=c99 -fopenmp -std=c99
gcc -pthread -B /home/ahyun/anaconda3/envs/py36torch041/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ahyun/anaconda3/envs/py36torch041/include/python3.6m -c /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/modulated_dcn.c -o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/modulated_dcn.o -std=c99 -fopenmp -std=c99
gcc -pthread -B /home/ahyun/anaconda3/envs/py36torch041/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ahyun/anaconda3/envs/py36torch041/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ahyun/anaconda3/envs/py36torch041/include/python3.6m -c /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/modulated_dcn_cuda.c -o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/modulated_dcn_cuda.o -std=c99 -fopenmp -std=c99
gcc -pthread -shared -B /home/ahyun/anaconda3/envs/py36torch041/compiler_compat -L/home/ahyun/anaconda3/envs/py36torch041/lib -Wl,-rpath=/home/ahyun/anaconda3/envs/py36torch041/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_modulated_dcn.o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/modulated_dcn.o ./home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/modulated_dcn_cuda.o /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/cuda/modulated_deform_im2col_cuda.cu.so /home/ahyun/cvlab/Deformable-Convolution-V2-PyTorch/src/cuda/deform_psroi_pooling_cuda.cu.so -o ./_modulated_dcn.so

I thought the build process went well, but I got

error in deformable_im2col: unknown error
error in deformable_col2im: unknown error
error in deformable_im2col: unknown error

from test.py

I use pytorch 0.4.1 python 3.6 and ubuntu 16.04 w/ cuda 9
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

Did I miss something?
+) I know I can switch to 1.0.0 and ignore the backward is not reentrant issue, but still I'm curious what is actually the unknown error means.

question about "CUDA_KERNEL_LOOP"

I am not familiar with CUDA programming and conv implementation in CUDA. So may I ask a stupid question?

In function deformable_im2col_gpu_kernel, is the loop in CUDA_KERNEL_LOOP executed only once? So that the CUDA_KERNEL_LOOP is acting like an if rather a for to check the thread index is within the data range N?
Or it makes no sense since the second iteration in CUDA_KERNEL_LOOP is going outside the grid of the CUDA kernel function.

win 10

anyone build it ok on win10.

Value Error: Optimizing a parameter that doesn't require gradients

I try to replace all the conv2D with ModulatedDeformConvPack, but encounter this problem.Could you provide some advices, which parameters maybe influence?
This's the log:

DCN_FastPose_SE(
(preact): DCN_SEResnet(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(3, 294, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3))
)
(bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace)
(maxpool): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
(layer1): Sequential(
(0): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(se): SELayer(
(fc): Sequential(
(0): Linear(in_features=128, out_features=128, bias=True)
(1): ReLU(inplace)
(2): Linear(in_features=128, out_features=128, bias=True)
(3): Sigmoid()
)
)
(downsample): Sequential(
(0): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 6, kernel_size=(1, 1), stride=(1, 1))
)
(1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(2): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(32, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(layer2): Sequential(
(0): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 54, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(se): SELayer(
(fc): Sequential(
(0): Linear(in_features=256, out_features=256, bias=True)
(1): ReLU(inplace)
(2): Linear(in_features=256, out_features=256, bias=True)
(3): Sigmoid()
)
)
(downsample): Sequential(
(0): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(2, 2))
)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(2): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(3): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(layer3): Sequential(
(0): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(se): SELayer(
(fc): Sequential(
(0): Linear(in_features=512, out_features=512, bias=True)
(1): ReLU(inplace)
(2): Linear(in_features=512, out_features=512, bias=True)
(3): Sigmoid()
)
)
(downsample): Sequential(
(0): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(2, 2))
)
(1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(2): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(3): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(4): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(5): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(layer4): Sequential(
(0): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 54, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(se): SELayer(
(fc): Sequential(
(0): Linear(in_features=1024, out_features=1024, bias=True)
(1): ReLU(inplace)
(2): Linear(in_features=1024, out_features=1024, bias=True)
(3): Sigmoid()
)
)
(downsample): Sequential(
(0): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(512, 6, kernel_size=(1, 1), stride=(2, 2))
)
(1): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(1024, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(2): Bottleneck(
(conv1): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(1024, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 6, kernel_size=(1, 1), stride=(1, 1))
)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
)
(suffle1): PixelShuffle(upscale_factor=2)
(duc1): DCN_DUC(
(conv): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(256, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace)
(pixel_shuffle): PixelShuffle(upscale_factor=2)
)
(duc2): DCN_DUC(
(conv): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(128, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
(bn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace)
(pixel_shuffle): PixelShuffle(upscale_factor=2)
)
(conv_out): ModulatedDeformConvPack(
(conv_offset_mask): Conv2d(64, 54, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
)
)
Create new model
Traceback (most recent call last):
File "train.py", line 215, in
main()
File "train.py", line 142, in main
weight_decay=opt.weightDecay)
File "/usr/local/lib/python3.5/dist-packages/torch/optim/rmsprop.py", line 41, in init
super(RMSprop, self).init(params, defaults)
File "/usr/local/lib/python3.5/dist-packages/torch/optim/optimizer.py", line 43, in init
self.add_param_group(param_group)
File "/usr/local/lib/python3.5/dist-packages/torch/optim/optimizer.py", line 193, in add_param_group
raise ValueError("optimizing a parameter that doesn't require gradients")
ValueError: optimizing a parameter that doesn't require gradients

The number of filter for generate offset is [num_deformable_groups * 2 * kH * kW]?

Inside the paper of Deformable ConvNets V2, a modulation scalars was used to modulate the input feature amplitudes from different spatial locations/bins. As the following description,

image

So, i'm curious about the usage example of DeformConv() in test.py , which setting the number of filter for generate offset as num_deformable_groups * 2 * kH * kW. Shouldn't it be num_deformable_groups * 3 * kH * kW?

Thanks a lot for your code, hope for your reply.

How to get pretrain weight?

I want to increase dcn into backbone (resnet101). Which weight should I use as the pre-training weight?

Pretrained Models

Hi,thanks for your work!
Can you provide sorme pretrained dcn models in MODEL_ZOO results? in Google/Baidu Drive or something else?

RuntimeError: Jacobian mismatch for output 0 with respect to input 0

When I run check_gradient_dconv( ), it will return this RuntimeError message. When I looked into the def gradcheck( ), I found that the output of analytical and numerical is different. Can you give me any advice to solve this Problem?

error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
error in deformable_col2im_cuda: too many resources requested for launch
Traceback (most recent call last):
File "/home/wanghanzhang/PycharmProjects/HANZHANG_WANG_LAB2/ls.py", line 661, in
check_gradient_dconv()
File "/home/wanghanzhang/PycharmProjects/HANZHANG_WANG_LAB2/ls.py", line 437, in check_gradient_dconv
eps=1e-6, atol=1e-5, rtol=1e-3, raise_exception=True))
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/gradcheck.py", line 205, in gradcheck
'numerical:%s\nanalytical:%s\n' % (i, j, n, a))
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/gradcheck.py", line 185, in fail_test
raise RuntimeError(msg)
RuntimeError: Jacobian mismatch for output 0 with respect to input 0,
numerical:tensor([[ 0.0713, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.1671, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.3468, 0.0345, ..., 0.0000, 0.0000, 0.0000],
...,
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, -0.2030, -0.2692],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, -0.1620, -0.4735],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, -0.1104]],
dtype=torch.float64)
analytical:tensor([[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., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]], dtype=torch.float64)

RuntimeError: cublas runtime error : an illegal memory access was encountered

Hi, I met an error when I set deformable_groups>=2 and the size of input is bigger than (2,3,128,128), the error is:
RuntimeError: cublas runtime error : resource allocation failed at /opt/conda/conda-bld/pytorch_1544202130060/work/aten/src/THC/THCGeneral.cpp:250 THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1544202130060/work/aten/src/THC/THCCachingHostAllocator.cpp line=265 error=77 : an illegal memory access was encountered

if the input is smaller than (2,3,128,128) or deformable_groups=1, the error disappear.
My environment: cuda 10, nvidia-418, pytorch 1.0 cudnn 7, gcc 7.3.0, ubuntu 18.04, dual 2080ti.

error in deformable_im2col: invalid argument

got error in deformable_im2col: invalid argument
when the input resolution of the image is 256x256.
similar to #13
but it doesn't solve it
hope this can be sloved. thanks

python 3.5/pytorch 0.4.1/cuda9.0

ImportError: : undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs

Traceback (most recent call last):
File "train.py", line 236, in
main()
File "train.py", line 138, in main
model = create_model(opt) # model loss optimize
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/init.py", line 9, in create_model
from .SR_model import SRModel as M
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/SR_model.py", line 7, in
import models.networks as networks
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/networks.py", line 3, in
import models.modules.SRResNet_arch as SRResNet_arch
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/modules/SRResNet_arch.py", line 4, in
import models.modules.module_util as mutil
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/modules/module_util.py", line 7, in
from deformable.modules.modulated_deform_conv import ModulatedDeformConv, _ModulatedDeformConv, ModulatedDeformConvPack
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/modules/deformable/modules/init.py", line 1, in
from .deform_conv import DeformConv, _DeformConv, DeformConvPack
File "/mnt/ftp/code/zq/realsr/de_BasicSR-master/codes/models/modules/deformable/modules/deform_conv.py", line 12, in
from functions.deform_conv_func import DeformConvFunction
File "/home/zq/anaconda3/envs/realsr/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/functions/init.py", line 1, in
from .deform_conv_func import DeformConvFunction
File "/home/zq/anaconda3/envs/realsr/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/functions/deform_conv_func.py", line 13, in
import DCN
ImportError: /home/zq/anaconda3/envs/realsr/lib/python3.6/site-packages/DCN-1.0-py3.6-linux-x86_64.egg/DCN.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs

Add shape checking for deformable_groups?

I found that only deform_conv on the master branch has shape checking for deformable_groups.

It may cause incomprehensible Cuda Runtime Error when the number of the input channel is divisible by deformable_groups.

Maybe adding some shape checkings is more friendly to use and there's no need to compile again when adding it in Python codes.

Changes can be seen at master branch and pytorch_1.0.0 branch in my repo.

error in deformable_col2im: invalid argument

I met an error: error in deformable_col2im: invalid argument when I run my program, and the program can continue running. But I didn't meet this error when I use the other dataset whose image size is (342, 342).

RuntimeError: Backward is not reentrant

It raises RuntimeError: Backward is not reentrant when i run the test.py.

torch.Size([2, 128, 128, 128])
torch.Size([2, 128, 128, 128])
torch.Size([20, 32, 7, 7])
torch.Size([20, 32, 7, 7])
torch.Size([20, 32, 7, 7])
checking
dconv im2col_step forward passed with 0.0
tensor(0., device='cuda:0', grad_fn=)
dconv im2col_step backward passed with 7.450580596923828e-09 = 7.450580596923828e-09+0.0+0.0+0.0
mdconv im2col_step forward passed with 0.0
tensor(0., device='cuda:0', grad_fn=)
mdconv im2col_step backward passed with 3.725290298461914e-09
0.971507, 1.943014
0.971507, 1.943014
tensor(0., device='cuda:0')
dconv zero offset passed with 1.1920928955078125e-07
dconv zero offset identify passed with 0.0
tensor(0., device='cuda:0')
mdconv zero offset passed with 1.7881393432617188e-07
mdconv zero offset identify passed with 0.0
check_gradient_conv: True
Traceback (most recent call last):
File "test.py", line 624, in
check_gradient_dconv()
File "test.py", line 400, in check_gradient_dconv
eps=1e-3, atol=1e-3, rtol=1e-2, raise_exception=True))
File "/data/yli18/miniconda3/envs/pytorch-1.0/lib/python3.6/site-packages/torch/autograd/gradcheck.py", line 208, in gradcheck
return fail_test('Backward is not reentrant, i.e., running backward with same '
File "/data/yli18/miniconda3/envs/pytorch-1.0/lib/python3.6/site-packages/torch/autograd/gradcheck.py", line 185, in fail_test
raise RuntimeError(msg)
RuntimeError: Backward is not reentrant, i.e., running backward with same input and grad_output multiple times gives different values, although analytical gradient matches numerical gradient

Is this a serious problem? and how can i resolve it?
Thanks for you time and suggestion.

The order of the offsets channels

The channels number of the offsets is groupkernelsizekernelsize*2, but what's the order of the channels? In other word, how the kernels of offsets flattened to 1D channel?

DCN on CPU

@chengdazhi hi thanks for the wonderful code base , i had ffew queries just wanted to check if we can use DCN in the CPU also or does it particularly require the GPU

pytorch 1.3 test error

in build progress warning this message:
/home/chenjun/Deformable-Convolution-V2-PyTorch-pytorch_1.0.0/src/cuda/deform_conv_cuda.cu:219:2309: warning: 鈥[01mT* at::Tensor::data() const [with T = float]鈥is deprecated [-Wdeprecated-declarations]
/home/chenjun/anaconda3/envs/torch13/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:303:1: note: declared here
when run test.py:
ImportError: /home/chenjun/anaconda3/envs/torch13/lib/python3.7/site-packages/DCN-1.0-py3.7-linux-x86_64.egg/DCN.cpython-37m-x86_64-linux-gnu.so: undefined symbol: cudaSetupArgument

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.