deformable-convolution-pytorch icon indicating copy to clipboard operation
deformable-convolution-pytorch copied to clipboard

test error !

Open zilesazoyi2 opened this issue 8 years ago • 4 comments

感谢您开源代码 但是test出问题了 能麻烦您给一个类似mnist的测试例子吗

sun@sunwin:~/0newcodedown/deformable-convolution-pytorch-master$ python test.py Traceback (most recent call last): File "test.py", line 6, in from modules import ConvOffset2d File "/home/sun/0newcodedown/deformable-convolution-pytorch-master/modules/init.py", line 1, in from .deform_conv import ConvOffset2d File "/home/sun/0newcodedown/deformable-convolution-pytorch-master/modules/deform_conv.py", line 7, in from functions import conv_offset2d File "/home/sun/0newcodedown/deformable-convolution-pytorch-master/functions/init.py", line 1, in from .deform_conv import conv_offset2d File "/home/sun/0newcodedown/deformable-convolution-pytorch-master/functions/deform_conv.py", line 5, in from _ext import deform_conv ImportError: No module named _ext

zilesazoyi2 avatar Oct 17 '17 08:10 zilesazoyi2

Did you skip the compiling step?

sh make.sh
CC=g++ python build.py

1zb avatar Oct 17 '17 08:10 1zb

非常感谢您的建议   sun@sunwin:~$ cd /home/sun/0newcodedown/deformable-convolution-pytorch-master sun@sunwin:~/0newcodedown/deformable-convolution-pytorch-master$ CC=g++ python build.py Including CUDA code. /home/sun/0newcodedown/deformable-convolution-pytorch-master generating /tmp/tmpRX3mGT/_deform_conv.c setting the current directory to '/tmp/tmpRX3mGT' running build_ext building '_deform_conv' extension creating home creating home/sun creating home/sun/0newcodedown creating home/sun/0newcodedown/deformable-convolution-pytorch-master creating home/sun/0newcodedown/deformable-convolution-pytorch-master/src g++ -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _deform_conv.c -o ./_deform_conv.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ g++ -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv.c -o ./home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ g++ -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv_cuda.c -o ./home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv_cuda.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_deform_conv.o ./home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv.o ./home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv_cuda.o /home/sun/0newcodedown/deformable-convolution-pytorch-master/src/deform_conv_cuda_kernel.cu.o -o ./_deform_conv.so sun@sunwin:~/0newcodedown/deformable-convolution-pytorch-master$ python test.py THCudaCheck FAIL file=/b/wheel/pytorch-src/torch/lib/THC/generic/THCStorage.cu line=66 error=2 : out of memory Traceback (most recent call last): File "test.py", line 20, in bias=False).cuda() File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 147, in cuda return self._apply(lambda t: t.cuda(device_id)) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 124, in _apply param.data = fn(param.data) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 147, in return self._apply(lambda t: t.cuda(device_id)) File "/usr/local/lib/python2.7/dist-packages/torch/_utils.py", line 65, in cuda return new_type(self.size()).copy(self, async) File "/usr/local/lib/python2.7/dist-packages/torch/cuda/init.py", line 275, in new return super(_CudaBase, cls).new(cls, *args, **kwargs) RuntimeError: cuda runtime error (2) : out of memory at /b/wheel/pytorch-src/torch/lib/THC/generic/THCStorage.cu:66 sun@sunwin:~/0newcodedown/deformable-convolution-pytorch-master$ 看起来内存不够用了呢 ╮(╯▽╰)╭ 

zilesazoyi2 avatar Oct 17 '17 09:10 zilesazoyi2

这个测试用到的显存不超过500M,你得检查下显存占用

1zb avatar Oct 17 '17 11:10 1zb

我关闭了tensorflow 看起来不出现错误啦 感谢\(^o^)/~ sun@sunwin:~/0newcodedown/deformable-convolution-pytorch-master$ python test.py (1L, 4L, 512L, 512L)

zilesazoyi2 avatar Oct 17 '17 12:10 zilesazoyi2