Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error #8

Open
Mrwvisa opened this issue Apr 12, 2021 · 0 comments
Open

Runtime error #8

Mrwvisa opened this issue Apr 12, 2021 · 0 comments

Comments

@Mrwvisa
Copy link

Mrwvisa commented Apr 12, 2021

I used the required version of mmcv and mmdetection, and generated fasterrcnn-backbone.pt and fasterrcnn-bbox.pt, When I run libtorch test_detector.cpp, the following reasoning error occurred. I tried to change the view to reshape or add contigous, but the following error still appears.I don't know what happened, need help from the author.

`
successfully create FasterRcnn detector
terminate called after throwing an instance of 'std::runtime_error'
what(): The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
File "code/torch/mmdet/models/detectors/faster_rcnn.py", line 50, in forward
_42 = torch.view(rpn_cls_score, [-1, 1])
_43 = torch.view(rpn_bbox_pred, [-1, 4])
_44 = [torch.view(_6, [-1, 1]), torch.view(_7, [-1, 1]), torch.view(_8, [-1, 1]), torch.view(_11, [-1, 1]), torch.view(_10, [-1, 1])]
~~~~~~~~~~ <--- HERE
return (_42, _43, torch.cat(_44, 0))

Traceback of TorchScript, original code (most recent call last):
~/workspace/mmdetection/mmdetection-2.7.0/mmdet/models/detectors/two_stage.py(209):
~/workspace/mmdetection/mmdetection-2.7.0/mmdet/models/detectors/two_stage.py(209): forward_trace_fasterrcnn
~/software/anaconda3/envs/last_mmdet/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward
~/software/anaconda3/envs/last_mmdet/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl
~/software/anaconda3/envs/last_mmdet/lib/python3.7/site-packages/torch/jit/_trace.py(940): trace_module
~/software/anaconda3/envs/last_mmdet/lib/python3.7/site-packages/torch/jit/_trace.py(742): trace
~/workspace/mmdetection/libtorch_threeyang/get_trace_two_stage.py(70): main
~/workspace/mmdetection/libtorch_threeyang/get_trace_two_stage.py(79): ###
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant