Open lizheng1992 opened 1 year ago
针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn In view of various problems in onnx model conversion, it is recommended to use the latest pnnx tool to convert your model to ncnn
pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224]
详细参考文档 Detailed reference documentation https://github.com/pnnx/pnnx https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx#how-to-use-pnnx
error log | 日志或报错信息 | ログ
base) ➜ bin git:(master) ./pnnx end2end.pt pnnxparam = end2end.pnnx.param pnnxbin = end2end.pnnx.bin pnnxpy = end2end_pnnx.py pnnxonnx = end2end.pnnx.onnx ncnnparam = end2end.ncnn.param ncnnbin = end2end.ncnn.bin ncnnpy = end2end_ncnn.py fp16 = 1 optlevel = 2 device = cpu inputshape = inputshape2 = customop = moduleop = terminate called after throwing an instance of 'torch::jit::ErrorReport' what():
Unknown builtin op: torchvision::nms. Could not find any similar ops to torchvision::nms. This op may not exist or may not be currently supported in TorchScript. : File "code/torch/torchvision/ops/boxes.py", line 24 _6 = torch.torchvision.extension._assert_has_ops _7 = _6() _8 = ops.torchvision.nms(boxes, scores, iou_threshold)