You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: