facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.29k stars 2.5k forks source link

Illegal Memory Access Error when Running Demo #897

Open leobxpan opened 5 years ago

leobxpan commented 5 years ago

❓ Questions and Help

Thank you for this wonderful repo. I encountered an issue when running the inference demo. This error happens when I passed in an image to do the detection. The error and traceback are pasted below:

THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch-nightly_1553749764730/work/aten/src/THC/THCCachingHostAllocator.cpp line=265 error=77 : an illegal memory access was encountered
Traceback (most recent call last):
  File "test.py", line 33, in <module>
    predictions = coco_demo.run_on_opencv_image(image)
  File "/sailhome/bxpan/maskrcnn-benchmark/demo/predictor.py", line 204, in run_on_opencv_image
    predictions = self.compute_prediction(image)
  File "/sailhome/bxpan/maskrcnn-benchmark/demo/predictor.py", line 237, in compute_prediction
    predictions = self.model(image_list)
  File "/vision2/u/bxpan/home/anaconda2/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/sailhome/bxpan/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py", line 50, in forward
    proposals, proposal_losses = self.rpn(images, features, targets)
  File "/vision2/u/bxpan/home/anaconda2/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/sailhome/bxpan/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py", line 156, in forward
    anchors = self.anchor_generator(images, features)
  File "/vision2/u/bxpan/home/anaconda2/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/sailhome/bxpan/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/anchor_generator.py", line 114, in forward
    anchors_over_all_feature_maps = self.grid_anchors(grid_sizes)
  File "/sailhome/bxpan/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/anchor_generator.py", line 89, in grid_anchors
    shifts = torch.stack((shift_x, shift_y, shift_x, shift_y), dim=1)
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /opt/conda/conda-bld/pytorch-nightly_1553749764730/work/aten/src/THC/THCCachingHostAllocator.cpp:265

Configurations:

Python: 3.7.3
Pytorch: 1.0.0.dev20190328 (1.0.0 nightly) 
torchvision: 0.2.2
CUDA: 9.0

I'm running this code on a single titan x gpu. Any help is greatly appreciated. Thanks in advance!

xk-zhang commented 1 year ago

Hello, have you solved this problem