Tencent / TNN

TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and performance optimization for mobile devices, and also draws on the advantages of good extensibility and high performance from existed open source efforts. TNN has been deployed in multiple Apps from Tencent, such as Mobile QQ, Weishi, Pitu, etc. Contributions are welcome to work in collaborative with us and make TNN a better framework.
Other
4.41k stars 771 forks source link

物体检测模型yolov5s.pt v5.0(官方下载)转换的tnn模型推理报错 #1358

Closed GitHubLuGeng closed 3 years ago

GitHubLuGeng commented 3 years ago

1. 环境(environment)

2.使用docker本地转换会报错如下: root@computer:/opt/TNN/tools/convert2tnn# python3 converter.py onnx2tnn /workspace/yolov5s-sim.onnx -o . -v v1.0 -optimize -align ---------- convert model, please wait a moment ----------

Converter ONNX to TNN Model...

Converter ONNX to TNN check_onnx_dim...

Converter ONNX to TNN check_onnx_dim...

Converter ONNX to TNN model failed!

root@computer:/opt/TNN/tools/convert2tnn#

3.附件 yolov5s-sim.zip yolov5s-sim.opt.tnn.zip

yolov5s-sim.zip是onnx模型 yolov5s-sim.opt.tnn.zip是在线转换的tnn模型

6. 运行日志(runtime log) root@computer:~/project/TNN/examples/linux/x86/build_linux_native$ ./demo_x86_objectdetectoryolov5 -p ../../../../model/yolov5/yolov5s-sim.opt.tnnproto -m ../../../../model/yolov5/yolov5s-sim.opt.tnnmodel Please choose the source you want to detect: Face-detector is about to start, and the picrture is ../../../assets/004545.jpg E/tnn: InferOutputShape [File /home/lu/project/TNN/source/tnn/layer/permute_layer.cc][Line 47] Permute param got wrong size. E/tnn: InferOutputShape [File /home/lu/project/TNN/source/tnn/layer/permute_layer.cc][Line 47] Permute param got wrong size. E/tnn: InferOutputShape [File /home/lu/project/TNN/source/tnn/layer/permute_layer.cc][Line 47] Permute param got wrong size. E/tnn: InferOutputShape [File /home/lu/project/TNN/source/tnn/layer/permute_layer.cc][Line 47] Permute param got wrong size. E/tnn: Init [File /home/lu/project/TNN/source/tnn/layer/base_layer.cc][Line 57] InferOutputShape failed E/tnn: InitLayers [File /home/lu/project/TNN/source/tnn/core/default_network.cc][Line 318] Error Init layer Transpose_260 (err: 4096 or 0x1000) Predictor Initing failed, please check the option parameters Segmentation fault (core dumped)

7. 截图(Screenshots)

 将截图粘贴在这里
 Paste screenshorts here or pastebin
1627180283 commented 3 years ago

convertmodel.com 的 tnn 转换工具暂时没有更新,还不支持直接转 yolo v5。 docker 和本地编译的转换工具是支持的,你 docker 转换的时候在转换命令里加上 -debug 看一下是什么问题。

GitHubLuGeng commented 3 years ago

找到原因了,没有编译onnx2tnn cd /tools/convert2tnn ./build.sh