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.4k stars 770 forks source link

yolov5模型ONNX转TNN失败 #1931

Open zhliuworks opened 1 year ago

zhliuworks commented 1 year ago

yolov5导出的ONNX模型,使用tnn-convert的docker转换,代码如下:

docker run \
-v $(pwd):/work \
-it tnn-convert:latest \
python3 ./converter.py onnx2tnn \
/work/$ONNX_PATH \
-optimize \
-align

报错如下:

----------  convert model, please wait a moment ----------

Converter ONNX to TNN Model...

Converter ONNX to TNN check_onnx_dim...

[ONNXRuntimeError] : 1 : FAIL : Load model from weights/best.onnx failed:/onnxruntime_src/onnxruntime/core/graph/model_load_utils.h:47 void onnxruntime::model_load_utils::ValidateOpsetForDomain(const std::unordered_map<std::basic_string<char>, int>&, const onnxruntime::logging::Logger&, bool, const string&, int) ONNX Runtime only *guarantees* support for models stamped with official released onnx opset versions. Opset 17 is under development and support for this is limited. The operator schemas and or other functionality may change before next ONNX release and in this case ONNX Runtime will not guarantee backward compatibility. Current official support for domain ai.onnx is till opset 15.

check_onnx_dim failed, next stage of convertion may failed too

Converter ONNX to TNN model succeed!

----------  align model (tflite or ONNX vs TNN),please wait a moment ----------

The weights/best.opt.tnnproto does not exist! please make sure the file exist!

请问这里onnx runtime不支持yolov5的哪个算子?