编辑:
之前没有发现工具链有更新,现在用新版的工具链(hbdk version 3.18.2 horizon_nn version 0.9.10 hb_mapper version 1.2.6)尝试了一下,简单的模型已经能够顺利转换了(op10),但是我们想要部署的模型(op11)仍然会出现以下报错:
ERROR HorizonRT not support these cpu operators: Where Gather Expand ScatterND

原始内容:
我在使用模型转换工具链转换onnx模型时出现报错No quantifiable nodes were found。起初以为是模型的问题,就先生成了一个更为简单的模型进行测试,但还是出现同样的报错,我在论坛上也没有搜索到类似的情况。请问可能是什么原因?
另外,请问,现在版本的模型转换工具链是否支持onnx opset_version=11?我们想要部署的模型在转换成onnx opset_version=10会有一些问题。
报错信息

log记录更详细信息:
2021-05-07 11:36:48,904 INFO hb_mapper_checker 67 Model type: onnx
2021-05-07 11:36:48,905 DEBUG hb_mapper_checker 68 march: bernoulli2
2021-05-07 11:36:48,905 INFO hb_mapper_checker 69 output file: ./playplay_checker.log
2021-05-07 11:36:48,907 INFO hb_mapper_checker 74 input names []
2021-05-07 11:36:48,907 INFO hb_mapper_checker 75 input shapes {}
2021-05-07 11:36:48,911 INFO hb_mapper_checker 81 Begin model checking....
2021-05-07 11:36:48,914 INFO build 36 [Fri May 7 11:36:48 2021] Start to Horizon NN Model Convert.
2021-05-07 11:36:48,915 INFO build 162 The input parameter is not specified, convert with default parameters.
2021-05-07 11:36:48,917 INFO build 346 The hbdk parameter is not specified, and the submodel will be compiled with the default parameter.
2021-05-07 11:36:48,921 INFO build 137 HorizonNN version: 0.9.7
2021-05-07 11:36:48,922 INFO build 141 HBDK version: 3.16.6
2021-05-07 11:36:48,923 INFO build 36 [Fri May 7 11:36:48 2021] Start to parse the onnx model.
2021-05-07 11:36:48,942 INFO onnx_parser 101 ONNX model info:
ONNX IR version: 6
Opset version: 10
Input name: 0, [25, 3]
2021-05-07 11:36:48,957 INFO build 39 [Fri May 7 11:36:48 2021] End to parse the onnx model.
2021-05-07 11:36:48,959 INFO build 457 Model input names: ['0']
2021-05-07 11:36:48,986 INFO build 821 Saving the original float model: ./.hb_check/original_float_model.onnx.
2021-05-07 11:36:48,987 INFO build 36 [Fri May 7 11:36:48 2021] Start to optimize the model.
2021-05-07 11:36:49,006 INFO build 39 [Fri May 7 11:36:49 2021] End to optimize the model.
2021-05-07 11:36:49,022 INFO build 832 Saving the optimized model: ./.hb_check/optimized_float_model.onnx.
2021-05-07 11:36:49,023 INFO build 36 [Fri May 7 11:36:49 2021] Start to calibrate the model.
2021-05-07 11:36:49,030 DEBUG tool_utils 95 exception in checker
2021-05-07 11:36:49,037 DEBUG tool_utils 96 Traceback (most recent call last):
File "/root/.local/lib/python3.6/site-packages/x3_tc_ui/utils/tool_utils.py", line 93, in __decorator
func(*args, **kargs)
File "/root/.local/lib/python3.6/site-packages/x3_tc_ui/hb_mapper.py", line 69, in checker
input_shape).run(version)
File "/root/.local/lib/python3.6/site-packages/x3_tc_ui/hb_mapper_checker.py", line 97, in run
**addtional_param)
File "/root/.local/lib/python3.6/site-packages/horizon_nn/build.py", line 1167, in check_onnx
return builder.build_model(original_model, save_model)
File "/root/.local/lib/python3.6/site-packages/horizon_nn/build.py", line 835, in build_model
calibration_table = self.model_calibration(optimized_model)
File "/root/.local/lib/python3.6/site-packages/horizon_nn/build.py", line 710, in model_calibration
optimized_model, self.march, "", self.node_dict)
File "/root/.local/lib/python3.6/site-packages/horizon_nn/horizon_onnx/quantizer.py", line 206, in create_pre_calibrated_model
node_dict)
horizon_nn.horizon_onnx.onnx_cpp2py_export.checker.ValidationError: No quantifiable nodes were found, and the model is not supported.
2021-05-07 11:36:49,037 ERROR tool_utils 97 No quantifiable nodes were found, and the model is not supported.
2021-05-07 11:36:49,038 INFO build 39 [Fri May 7 11:36:49 2021] End to calibrate the model.
2021-05-07 11:36:49,046 INFO build 39 [Fri May 7 11:36:49 2021] End to Horizon NN Model Convert.
使用Netron查看onnx模型信息如下:

使用Netron查看checker优化后onnx模型信息如下(./.hb_check/optimized_float_model.onnx.):



