facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.55k stars 7.49k forks source link

RuntimeError: Not compiled with GPU support (ROIAlign_forward at /home/hd/detectron2_repo/detectron2/layers/csrc/ROIAlign/ROIAlign.h:73) #267

Closed XuanyuanDi closed 5 years ago

XuanyuanDi commented 5 years ago

Traceback (most recent call last): File "/home/hd/PycharmProjects/HelloWorld/11.py", line 27, in outputs = predictor(im) File "/home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad return func(*args, kwargs) File "/home/hd/detectron2_repo/detectron2/engine/defaults.py", line 177, in call predictions = self.model([inputs])[0] File "/home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/home/hd/detectron2_repo/detectron2/modeling/meta_arch/rcnn.py", line 66, in forward return self.inference(batched_inputs) File "/home/hd/detectron2_repo/detectron2/modeling/metaarch/rcnn.py", line 124, in inference results, = self.roi_heads(images, features, proposals, None) File "/home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, kwargs) File "/home/hd/detectron2_repo/detectron2/modeling/roi_heads/roi_heads.py", line 568, in forward pred_instances = self._forward_box(features_list, proposals) File "/home/hd/detectron2_repo/detectron2/modeling/roi_heads/roi_heads.py", line 615, in _forward_box box_features = self.box_pooler(features, [x.proposal_boxes for x in proposals]) File "/home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/home/hd/detectron2_repo/detectron2/modeling/poolers.py", line 208, in forward output[inds] = pooler(x_level, pooler_fmt_boxes_level) File "/home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, *kwargs) File "/home/hd/detectron2_repo/detectron2/layers/roi_align.py", line 95, in forward input, rois, self.output_size, self.spatial_scale, self.sampling_ratio, self.aligned File "/home/hd/detectron2_repo/detectron2/layers/roi_align.py", line 20, in forward input, roi, spatial_scale, output_size[0], output_size[1], sampling_ratio, aligned RuntimeError: Not compiled with GPU support (ROIAlign_forward at /home/hd/detectron2_repo/detectron2/layers/csrc/ROIAlign/ROIAlign.h:73) frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7fd5011ac813 in /home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/lib/libc10.so) frame #1: detectron2::ROIAlign_forward(at::Tensor const&, at::Tensor const&, float, int, int, int, bool) + 0x171 (0x7fd4ef2f94a1 in /home/hd/detectron2_repo/detectron2/_C.cpython-36m-x86_64-linux-gnu.so) frame #2: + 0x215be (0x7fd4ef3095be in /home/hd/detectron2_repo/detectron2/_C.cpython-36m-x86_64-linux-gnu.so) frame #3: + 0x1c3a0 (0x7fd4ef3043a0 in /home/hd/detectron2_repo/detectron2/_C.cpython-36m-x86_64-linux-gnu.so) frame #4: _PyCFunction_FastCallDict + 0x154 (0x556b99776b44 in /home/hd/anaconda3/envs/det/bin/python) frame #5: + 0x1a155c (0x556b9980455c in /home/hd/anaconda3/envs/det/bin/python) frame #6: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python) frame #7: PyEval_EvalCodeEx + 0x329 (0x556b997d9069 in /home/hd/anaconda3/envs/det/bin/python) frame #8: + 0x176e74 (0x556b997d9e74 in /home/hd/anaconda3/envs/det/bin/python) frame #9: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #10: THPFunction_apply(_object, _object*) + 0xa4f (0x7fd55f5b04af in /home/hd/anaconda3/envs/det/lib/python3.6/site-packages/torch/lib/libtorch_python.so) frame #11: _PyCFunction_FastCallDict + 0x91 (0x556b99776a81 in /home/hd/anaconda3/envs/det/bin/python) frame #12: + 0x1a155c (0x556b9980455c in /home/hd/anaconda3/envs/det/bin/python) frame #13: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python) frame #14: _PyFunction_FastCallDict + 0x11b (0x556b997d50cb in /home/hd/anaconda3/envs/det/bin/python) frame #15: _PyObject_FastCallDict + 0x26f (0x556b99776f0f in /home/hd/anaconda3/envs/det/bin/python) frame #16: _PyObject_Call_Prepend + 0x63 (0x556b9977bb33 in /home/hd/anaconda3/envs/det/bin/python) frame #17: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #18: _PyEval_EvalFrameDefault + 0x1a92 (0x556b9982af32 in /home/hd/anaconda3/envs/det/bin/python) frame #19: + 0x170cf6 (0x556b997d3cf6 in /home/hd/anaconda3/envs/det/bin/python) frame #20: _PyFunction_FastCallDict + 0x1bc (0x556b997d516c in /home/hd/anaconda3/envs/det/bin/python) frame #21: _PyObject_FastCallDict + 0x26f (0x556b99776f0f in /home/hd/anaconda3/envs/det/bin/python) frame #22: _PyObject_Call_Prepend + 0x63 (0x556b9977bb33 in /home/hd/anaconda3/envs/det/bin/python) frame #23: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #24: + 0x15cde7 (0x556b997bfde7 in /home/hd/anaconda3/envs/det/bin/python) frame #25: _PyObject_FastCallDict + 0x8b (0x556b99776d2b in /home/hd/anaconda3/envs/det/bin/python) frame #26: + 0x1a16ae (0x556b998046ae in /home/hd/anaconda3/envs/det/bin/python) frame #27: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python) frame #28: _PyFunction_FastCallDict + 0x11b (0x556b997d50cb in /home/hd/anaconda3/envs/det/bin/python) frame #29: _PyObject_FastCallDict + 0x26f (0x556b99776f0f in /home/hd/anaconda3/envs/det/bin/python) frame #30: _PyObject_Call_Prepend + 0x63 (0x556b9977bb33 in /home/hd/anaconda3/envs/det/bin/python) frame #31: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #32: _PyEval_EvalFrameDefault + 0x1a92 (0x556b9982af32 in /home/hd/anaconda3/envs/det/bin/python) frame #33: + 0x170cf6 (0x556b997d3cf6 in /home/hd/anaconda3/envs/det/bin/python) frame #34: _PyFunction_FastCallDict + 0x1bc (0x556b997d516c in /home/hd/anaconda3/envs/det/bin/python) frame #35: _PyObject_FastCallDict + 0x26f (0x556b99776f0f in /home/hd/anaconda3/envs/det/bin/python) frame #36: _PyObject_Call_Prepend + 0x63 (0x556b9977bb33 in /home/hd/anaconda3/envs/det/bin/python) frame #37: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #38: + 0x15cde7 (0x556b997bfde7 in /home/hd/anaconda3/envs/det/bin/python) frame #39: _PyObject_FastCallDict + 0x8b (0x556b99776d2b in /home/hd/anaconda3/envs/det/bin/python) frame #40: + 0x1a16ae (0x556b998046ae in /home/hd/anaconda3/envs/det/bin/python) frame #41: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python) frame #42: + 0x171a5b (0x556b997d4a5b in /home/hd/anaconda3/envs/det/bin/python) frame #43: + 0x1a1635 (0x556b99804635 in /home/hd/anaconda3/envs/det/bin/python) frame #44: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python) frame #45: + 0x17114e (0x556b997d414e in /home/hd/anaconda3/envs/det/bin/python) frame #46: _PyFunction_FastCallDict + 0x3da (0x556b997d538a in /home/hd/anaconda3/envs/det/bin/python) frame #47: _PyObject_FastCallDict + 0x26f (0x556b99776f0f in /home/hd/anaconda3/envs/det/bin/python) frame #48: _PyObject_Call_Prepend + 0x63 (0x556b9977bb33 in /home/hd/anaconda3/envs/det/bin/python) frame #49: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #50: _PyEval_EvalFrameDefault + 0x1a92 (0x556b9982af32 in /home/hd/anaconda3/envs/det/bin/python) frame #51: + 0x170cf6 (0x556b997d3cf6 in /home/hd/anaconda3/envs/det/bin/python) frame #52: _PyFunction_FastCallDict + 0x1bc (0x556b997d516c in /home/hd/anaconda3/envs/det/bin/python) frame #53: _PyObject_FastCallDict + 0x26f (0x556b99776f0f in /home/hd/anaconda3/envs/det/bin/python) frame #54: _PyObject_Call_Prepend + 0x63 (0x556b9977bb33 in /home/hd/anaconda3/envs/det/bin/python) frame #55: PyObject_Call + 0x3e (0x556b9977694e in /home/hd/anaconda3/envs/det/bin/python) frame #56: + 0x15cde7 (0x556b997bfde7 in /home/hd/anaconda3/envs/det/bin/python) frame #57: _PyObject_FastCallDict + 0x8b (0x556b99776d2b in /home/hd/anaconda3/envs/det/bin/python) frame #58: + 0x1a16ae (0x556b998046ae in /home/hd/anaconda3/envs/det/bin/python) frame #59: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python) frame #60: + 0x17114e (0x556b997d414e in /home/hd/anaconda3/envs/det/bin/python) frame #61: + 0x171c91 (0x556b997d4c91 in /home/hd/anaconda3/envs/det/bin/python) frame #62: + 0x1a1635 (0x556b99804635 in /home/hd/anaconda3/envs/det/bin/python) frame #63: _PyEval_EvalFrameDefault + 0x30a (0x556b998297aa in /home/hd/anaconda3/envs/det/bin/python)

XuanyuanDi commented 5 years ago

I don't know what's wrong since my env satisfied all the requirements: Python >= 3.6 PyTorch 1.3 torchvision 0.4.1 OpenCV pycocotools GCC >= 4.9

I tried to reinstall Nvidia Driver 440 and Cuda 10.1, but still get this error. Can you give me some suggestions or solutions? Thank you.

ppwwyyxx commented 5 years ago

Please include details about the problem following the issue template.

mmxuan18 commented 5 years ago

i meet the same error

nicolasmetallo commented 5 years ago

Same error here. See issue 62.

mmxuan18 commented 5 years ago

i fixed this by use env FORCE_CUDA=1 recompile torchvision and detectron2, but this can't do with cuda9, and need to compile with gpu device machine not only with cuda

ppwwyyxx commented 5 years ago

Closing as the information requested in issue template is not provided.