重现步骤
按照文档操作,导出onnx后运行to_kmodel.py
期待结果和实际结果
未报错只有warning但无kmodel文件生成
通过添加打印调试,发现to_kmodel.py运行到onnx_simplify()中的:
onnx_model = onnx.shape_inference.infer_shapes(onnx_model)
后结束,尝试通过try捕获错误信息但没有任何结果
软硬件版本信息
Windows 11
nncase 2.9.0
nncase-kpu 2.9.0
错误日志
(nncase) C:\a\test_yolo11\detect>python to_kmodel.py --target k230 --model ../../runs/detect/train/weights/best.onnx --dataset ../test --input_width 320 --input_height 320 --ptq_option 0
warn: Nncase.Hosting.PluginLoader[0]
NNCASE_PLUGIN_PATH is not set.
C:\a\test_yolo11\detect\to_kmodel.py:25: DeprecationWarning: `mapping.TENSOR_TYPE_TO_NP_TYPE` is now deprecated and will be removed in a future release.To silence this warning, please use `helper.tensor_dtype_to_np_dtype` instead.
input_dict['dtype'] = onnx.mapping.TENSOR_TYPE_TO_NP_TYPE[onnx_type.elem_type]
(nncase) C:\a\test_yolo11\detect>
尝试解决过程
运行to_kmodel.py后留下空tmp文件夹
补充材料