{"action":"created","issue":{"url":"https://api.github.com/repos/open-mmlab/mmdetection/issues/22","repository_url":"https://api.github.com/repos/open-mmlab/mmdetection","labels_url":"https://api.github.com/repos/open-mmlab/mmdetection/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/open-mmlab/mmdetection/issues/22/comments","events_url":"https://api.github.com/repos/open-mmlab/mmdetection/issues/22/events","html_url":"https://github.com/open-mmlab/mmdetection/issues/22","id":369758054,"node_id":"MDU6SXNzdWUzNjk3NTgwNTQ=","number":22,"title":"ImportError:  roi_align_cuda","user":{"login":"ZengyuanYu","id":31333405,"node_id":"MDQ6VXNlcjMxMzMzNDA1","avatar_url":"https://avatars2.githubusercontent.com/u/31333405?v=4","gravatar_id":"","url":"https://api.github.com/users/ZengyuanYu","html_url":"https://github.com/ZengyuanYu","followers_url":"https://api.github.com/users/ZengyuanYu/followers","following_url":"https://api.github.com/users/ZengyuanYu/following{/other_user}","gists_url":"https://api.github.com/users/ZengyuanYu/gists{/gist_id}","starred_url":"https://api.github.com/users/ZengyuanYu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZengyuanYu/subscriptions","organizations_url":"https://api.github.com/users/ZengyuanYu/orgs","repos_url":"https://api.github.com/users/ZengyuanYu/repos","events_url":"https://api.github.com/users/ZengyuanYu/events{/privacy}","received_events_url":"https://api.github.com/users/ZengyuanYu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-10-13T02:26:07Z","updated_at":"2018-10-16T12:35:38Z","closed_at":null,"author_association":"NONE","body":"Ｉ compiled and test images use this example, but when I import, I go this error?\r\nTraceback (most recent call last):\r\n  File \"tools/test.py\", line 9, in <module>\r\n    from mmdet.core import results2json, coco_eval\r\n  File \"/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/mmdet/core/__init__.py\", line 6, in <module>\r\n    from .post_processing import *  # noqa: F401, F403\r\n  File \"/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/mmdet/core/post_processing/__init__.py\", line 1, in <module>\r\n    from .bbox_nms import multiclass_nms\r\n  File \"/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/mmdet/core/post_processing/bbox_nms.py\", line 3, in <module>\r\n    from mmdet.ops import nms\r\n  File \"/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/mmdet/ops/__init__.py\", line 2, in <module>\r\n    from .roi_align import RoIAlign, roi_align\r\n  File \"/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/mmdet/ops/roi_align/__init__.py\", line 1, in <module>\r\n    from .functions.roi_align import roi_align\r\n  File \"/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/mmdet/ops/roi_align/functions/roi_align.py\", line 3, in <module>\r\n    from .. import roi_align_cuda\r\nImportError: cannot import name 'roi_align_cuda'\r\n\r\nI check floder, no roi_align_cuda, How I solve it? Messges in my compile:\r\nBuilding roi align op...\r\nrunning build_ext\r\nbuilding 'roi_align_cuda' extension\r\ncreating build\r\ncreating build/temp.linux-x86_64-3.5\r\ncreating build/temp.linux-x86_64-3.5/src\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/torch/lib/include -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/torch/lib/include/TH -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -I/home/yu/.virtualenvs/Pytorch/include/python3.5m -c src/roi_align_cuda.cpp -o build/temp.linux-x86_64-3.5/src/roi_align_cuda.o -DTORCH_EXTENSION_NAME=roi_align_cuda -std=c++11\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nsrc/roi_align_cuda.cpp: In function ‘int roi_align_forward_cuda(at::Tensor, at::Tensor, int, int, float, int, at::Tensor)’:\r\nsrc/roi_align_cuda.cpp:20:80: error: ‘AT_CHECK’ was not declared in this scope\r\n #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, \" must be a CUDAtensor \")\r\n                                                                                ^\r\nsrc/roi_align_cuda.cpp:24:3: note: in expansion of macro ‘CHECK_CUDA’\r\n   CHECK_CUDA(x);       \\\r\n   ^\r\nsrc/roi_align_cuda.cpp:31:3: note: in expansion of macro ‘CHECK_INPUT’\r\n   CHECK_INPUT(features);\r\n   ^\r\nsrc/roi_align_cuda.cpp: In function ‘int roi_align_backward_cuda(at::Tensor, at::Tensor, int, int, float, int, at::Tensor)’:\r\nsrc/roi_align_cuda.cpp:20:80: error: ‘AT_CHECK’ was not declared in this scope\r\n #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, \" must be a CUDAtensor \")\r\n                                                                                ^\r\nsrc/roi_align_cuda.cpp:24:3: note: in expansion of macro ‘CHECK_CUDA’\r\n   CHECK_CUDA(x);       \\\r\n   ^\r\nsrc/roi_align_cuda.cpp:59:3: note: in expansion of macro ‘CHECK_INPUT’\r\n   CHECK_INPUT(top_grad);\r\n   ^\r\nerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1\r\nBuilding roi pool op...\r\nrunning build_ext\r\nbuilding 'roi_pool_cuda' extension\r\ncreating build\r\ncreating build/temp.linux-x86_64-3.5\r\ncreating build/temp.linux-x86_64-3.5/src\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/torch/lib/include -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/torch/lib/include/TH -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -I/home/yu/.virtualenvs/Pytorch/include/python3.5m -c src/roi_pool_cuda.cpp -o build/temp.linux-x86_64-3.5/src/roi_pool_cuda.o -DTORCH_EXTENSION_NAME=roi_pool_cuda -std=c++11\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nsrc/roi_pool_cuda.cpp: In function ‘int roi_pooling_forward_cuda(at::Tensor, at::Tensor, int, int, float, at::Tensor, at::Tensor)’:\r\nsrc/roi_pool_cuda.cpp:19:80: error: ‘AT_CHECK’ was not declared in this scope\r\n #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, \" must be a CUDAtensor \")\r\n                                                                                ^\r\nsrc/roi_pool_cuda.cpp:23:3: note: in expansion of macro ‘CHECK_CUDA’\r\n   CHECK_CUDA(x);       \\\r\n   ^\r\nsrc/roi_pool_cuda.cpp:30:3: note: in expansion of macro ‘CHECK_INPUT’\r\n   CHECK_INPUT(features);\r\n   ^\r\nsrc/roi_pool_cuda.cpp: In function ‘int roi_pooling_backward_cuda(at::Tensor, at::Tensor, at::Tensor, float, at::Tensor)’:\r\nsrc/roi_pool_cuda.cpp:19:80: error: ‘AT_CHECK’ was not declared in this scope\r\n #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, \" must be a CUDAtensor \")\r\n                                                                                ^\r\nsrc/roi_pool_cuda.cpp:23:3: note: in expansion of macro ‘CHECK_CUDA’\r\n   CHECK_CUDA(x);       \\\r\n   ^\r\nsrc/roi_pool_cuda.cpp:57:3: note: in expansion of macro ‘CHECK_INPUT’\r\n   CHECK_INPUT(top_grad);\r\n   ^\r\nerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1\r\nBuilding nms op...\r\nrm *.so\r\necho \"Compiling nms kernels...\"\r\nCompiling nms kernels...\r\npython setup.py build_ext --inplace\r\nrunning build_ext\r\nbuilding 'cpu_nms' extension\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/cuda/include -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/yu/.virtualenvs/Pytorch/include/python3.5m -c cpu_nms.cpp -o build/temp.linux-x86_64-3.5/cpu_nms.o -Wno-unused-function -Wno-write-strings\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nIn file included from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,\r\n                 from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,\r\n                 from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,\r\n                 from cpu_nms.cpp:621:\r\n/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning \"Using deprecated NumPy API, disable it by \" \"#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\r\n #warning \"Using deprecated NumPy API, disable it by \" \\\r\n  ^\r\nx86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/cpu_nms.o -L/usr/local/cuda/lib64 -lcudart -o /home/yu/mmdetection/mmdet/ops/nms/cpu_nms.cpython-35m-x86_64-linux-gnu.so\r\nbuilding 'gpu_nms' extension\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/cuda/include -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/yu/.virtualenvs/Pytorch/include/python3.5m -c gpu_nms.cpp -o build/temp.linux-x86_64-3.5/gpu_nms.o -Wno-unused-function -Wno-write-strings\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nIn file included from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,\r\n                 from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,\r\n                 from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,\r\n                 from gpu_nms.cpp:623:\r\n/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning \"Using deprecated NumPy API, disable it by \" \"#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\r\n #warning \"Using deprecated NumPy API, disable it by \" \\\r\n  ^\r\n/usr/local/cuda/bin/nvcc -I/usr/local/cuda/include -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/yu/.virtualenvs/Pytorch/include/python3.5m -c nms_kernel.cu -o build/temp.linux-x86_64-3.5/nms_kernel.o -arch=sm_52 --ptxas-options=-v -c --compiler-options -fPIC\r\nptxas info    : 0 bytes gmem\r\nptxas info    : Compiling entry function '_Z10nms_kernelifPKfPy' for 'sm_52'\r\nptxas info    : Function properties for _Z10nms_kernelifPKfPy\r\n    128 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads\r\nptxas info    : Used 38 registers, 20480 bytes smem, 344 bytes cmem[0], 12 bytes cmem[2]\r\nx86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/gpu_nms.o build/temp.linux-x86_64-3.5/nms_kernel.o -L/usr/local/cuda/lib64 -lcudart -o /home/yu/mmdetection/mmdet/ops/nms/gpu_nms.cpython-35m-x86_64-linux-gnu.so\r\nbuilding 'cpu_soft_nms' extension\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/cuda/include -I/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/yu/.virtualenvs/Pytorch/include/python3.5m -c cpu_soft_nms.cpp -o build/temp.linux-x86_64-3.5/cpu_soft_nms.o -Wno-unused-function -Wno-write-strings\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nIn file included from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,\r\n                 from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,\r\n                 from /home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,\r\n                 from cpu_soft_nms.cpp:621:\r\n/home/yu/.virtualenvs/Pytorch/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning \"Using deprecated NumPy API, disable it by \" \"#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\r\n #warning \"Using deprecated NumPy API, disable it by \" \\\r\n  ^\r\ncpu_soft_nms.cpp: In function ‘PyObject* __pyx_pf_12cpu_soft_nms_cpu_soft_nms(PyObject*, PyArrayObject*, float, float, float, unsigned int)’:\r\ncpu_soft_nms.cpp:2450:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n       __pyx_t_11 = ((__pyx_v_pos < __pyx_v_N) != 0);\r\n                                  ^\r\ncpu_soft_nms.cpp:2961:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n       __pyx_t_11 = ((__pyx_v_pos < __pyx_v_N) != 0);\r\n                                  ^\r\nx86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/cpu_soft_nms.o -L/usr/local/cuda/lib64 -lcudart -o /home/yu/mmdetection/mmdet/ops/nms/cpu_soft_nms.cpython-35m-x86_64-linux-gnu.so\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/open-mmlab/mmdetection/issues/comments/430220097","html_url":"https://github.com/open-mmlab/mmdetection/issues/22#issuecomment-430220097","issue_url":"https://api.github.com/repos/open-mmlab/mmdetection/issues/22","id":430220097,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDIyMDA5Nw==","user":{"login":"hellock","id":9102141,"node_id":"MDQ6VXNlcjkxMDIxNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/9102141?v=4","gravatar_id":"","url":"https://api.github.com/users/hellock","html_url":"https://github.com/hellock","followers_url":"https://api.github.com/users/hellock/followers","following_url":"https://api.github.com/users/hellock/following{/other_user}","gists_url":"https://api.github.com/users/hellock/gists{/gist_id}","starred_url":"https://api.github.com/users/hellock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellock/subscriptions","organizations_url":"https://api.github.com/users/hellock/orgs","repos_url":"https://api.github.com/users/hellock/repos","events_url":"https://api.github.com/users/hellock/events{/privacy}","received_events_url":"https://api.github.com/users/hellock/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T12:35:38Z","updated_at":"2018-10-16T12:35:38Z","author_association":"CONTRIBUTOR","body":"Hi @fabienbaradel, you may try this, supposing that `/usr/local/cuda` is your cuda root path.\r\n```\r\nexport $LD_LIBRARY_PATH=\"/usr/local/cuda/lib64:$LD_LIBRARY_PATH\"\r\n./compile.sh\r\n```"}}
{"actor":{"display_login":"hellock"}}