DevashishPrasad / CascadeTabNet

This repository contains the code and implementation details of the CascadeTabNet paper "CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents"
MIT License
1.49k stars 427 forks source link

RuntimeError: cuda runtime error (209) : unrecognized error code at mmdet/ops/roi_align/src/roi_align_kernel.cu:139 #49

Closed Anuradhabala26 closed 4 years ago

Anuradhabala26 commented 4 years ago

I'm trying to run ICDAR-13 model. But I'm getting this error.


RuntimeError Traceback (most recent call last)

in () 10 11 # Run Inference ---> 12 result = inference_detector(model, img) 13 14 # Visualization results 11 frames /content/drive/My Drive/mmdetection/mmdet/apis/inference.py in inference_detector(model, img) 84 # forward the model 85 with torch.no_grad(): ---> 86 result = model(return_loss=False, rescale=True, **data) 87 return result 88 /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs) 530 result = self._slow_forward(*input, **kwargs) 531 else: --> 532 result = self.forward(*input, **kwargs) 533 for hook in self._forward_hooks.values(): 534 hook_result = hook(self, input, result) /content/drive/My Drive/mmdetection/mmdet/core/fp16/decorators.py in new_func(*args, **kwargs) 47 'method of nn.Module') 48 if not (hasattr(args[0], 'fp16_enabled') and args[0].fp16_enabled): ---> 49 return old_func(*args, **kwargs) 50 # get the arg spec of the decorated method 51 args_info = getfullargspec(old_func) /content/drive/My Drive/mmdetection/mmdet/models/detectors/base.py in forward(self, img, img_metas, return_loss, **kwargs) 147 return self.forward_train(img, img_metas, **kwargs) 148 else: --> 149 return self.forward_test(img, img_metas, **kwargs) 150 151 def show_result(self, data, result, dataset=None, score_thr=0.3): /content/drive/My Drive/mmdetection/mmdet/models/detectors/base.py in forward_test(self, imgs, img_metas, **kwargs) 128 if 'proposals' in kwargs: 129 kwargs['proposals'] = kwargs['proposals'][0] --> 130 return self.simple_test(imgs[0], img_metas[0], **kwargs) 131 else: 132 # TODO: support test augmentation for predefined proposals /content/drive/My Drive/mmdetection/mmdet/models/detectors/cascade_rcnn.py in simple_test(self, img, img_metas, proposals, rescale) 340 341 bbox_feats = bbox_roi_extractor( --> 342 x[:len(bbox_roi_extractor.featmap_strides)], rois) 343 if self.with_shared_head: 344 bbox_feats = self.shared_head(bbox_feats) /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs) 530 result = self._slow_forward(*input, **kwargs) 531 else: --> 532 result = self.forward(*input, **kwargs) 533 for hook in self._forward_hooks.values(): 534 hook_result = hook(self, input, result) /content/drive/My Drive/mmdetection/mmdet/core/fp16/decorators.py in new_func(*args, **kwargs) 125 'method of nn.Module') 126 if not (hasattr(args[0], 'fp16_enabled') and args[0].fp16_enabled): --> 127 return old_func(*args, **kwargs) 128 # get the arg spec of the decorated method 129 args_info = getfullargspec(old_func) /content/drive/My Drive/mmdetection/mmdet/models/roi_extractors/single_level.py in forward(self, feats, rois, roi_scale_factor) 103 if inds.any(): 104 rois_ = rois[inds, :] --> 105 roi_feats_t = self.roi_layers[i](feats[i], rois_) 106 roi_feats[inds] = roi_feats_t 107 return roi_feats /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs) 530 result = self._slow_forward(*input, **kwargs) 531 else: --> 532 result = self.forward(*input, **kwargs) 533 for hook in self._forward_hooks.values(): 534 hook_result = hook(self, input, result) /content/drive/My Drive/mmdetection/mmdet/ops/roi_align/roi_align.py in forward(self, features, rois) 142 else: 143 return roi_align(features, rois, self.out_size, self.spatial_scale, --> 144 self.sample_num, self.aligned) 145 146 def __repr__(self): /content/drive/My Drive/mmdetection/mmdet/ops/roi_align/roi_align.py in forward(ctx, features, rois, out_size, spatial_scale, sample_num, aligned) 34 out_w) 35 roi_align_cuda.forward_v1(features, rois, out_h, out_w, ---> 36 spatial_scale, sample_num, output) 37 else: 38 output = roi_align_cuda.forward_v2(features, rois, RuntimeError: cuda runtime error (209) : unrecognized error code at mmdet/ops/roi_align/src/roi_align_kernel.cu:139 Can anyone help me solve this?? Thanks in advance.
DevashishPrasad commented 4 years ago

Did you try restart runtime?

And check the GPU you have been alloted using !nvidia-smi

if you got different GPU then you need to install and build Mmdetection for new GPU again

Anuradhabala26 commented 4 years ago

Thank you so much. Sorry for the late reply.

leooooliu commented 4 years ago

Hi, I got the same error when running your demo. Demo works like 1. then kernal got disconnected then the demo never works again. Please help me.

RuntimeError Traceback (most recent call last)

in () 2 from google.colab.patches import cv2_imshow 3 img = "./CascadeTabNet/Demo/tbl/tbl/Stock_Open_close.PNG" ----> 4 result = inference_detector(model, img) 5 # show_result_pyplot(img, result,('Bordered', 'cell', 'Borderless'), score_thr=0.85) 6 im = cv2.imread(img) 11 frames /content/gdrive/My Drive/github/mmdetection/mmdet/ops/roi_align/roi_align.py in forward(ctx, features, rois, out_size, spatial_scale, sample_num, aligned) 34 out_w) 35 roi_align_cuda.forward_v1(features, rois, out_h, out_w, ---> 36 spatial_scale, sample_num, output) 37 else: 38 output = roi_align_cuda.forward_v2(features, rois, RuntimeError: cuda runtime error (209) : unrecognized error code at mmdet/ops/roi_align/src/roi_align_kernel.cu:139
DevashishPrasad commented 4 years ago

Try to delete the mmdetection and build it again