Open YousefHesham7 opened 2 years ago
What is the version of your mmdet and mmcv libraries?
I have the same issue using scrfd_34g and mmcv-full 1.3.5 and mmdet 2.7.0
same issue, did you solve it ?
lib/python3.7/site-packages/torch/onnx/utils.py
# args = _decide_input_format(model, args)
sovled it
using mmcv 1.7.1 @Z-Xiong Commented out at three locations got error /lib/python3.9/site-packages/torch/nn/modules/batchnorm.py", line 410, in _check_input_dim raise ValueError("expected 4D input (got {}D input)".format(input.dim())) ValueError: expected 4D input (got 3D input)
@Z-Xiong it worked for me. need comment the _decide_input_format in the calling function.
For python 3.8, we need comment the _decide_input_format at line 1069 as the error stacktrace hint. "/home/yousef/Desktop/IN3/insightface/detection/scrfd/venv/lib/python3.8/site-packages/torch/onnx/utils.py", line 1074, in _export"
@quanqigu mdet/models/dense_heads/scrfd_head.py", line 802, in _get_bboxes_single scores = cls_score.permute(1, 2, 0).reshape( RuntimeError: number of dims don't match in permute
in-onnx-export torch.Size([1, 2, 80, 80]) torch.Size([1, 8, 80, 80]) in-onnx-export torch.Size([1, 2, 40, 40]) torch.Size([1, 8, 40, 40]) in-onnx-export torch.Size([1, 2, 20, 20]) torch.Size([1, 8, 20, 20])
cls_score shape is torch.Size([12800, 1])
shape has issue but why? can help? Thankyou
Hello,
I'm getting the following error while trying to convert any of the SCRFD .pth models to onnx using scrfd2onnx.py
Here's the used command:
python3 tools/scrfd2onnx.py configs/scrfd/scrfd_2.5g.py tools/models/SCRFD_2.5G.pth
Here's what I'm getting: