Closed wozwdaqian closed 1 year ago
@wozwdaqian onnx模型上传一下
@wozwdaqian onnx模型上传一下
@curioyang yolov5s.zip yolov5s_pt2onnx.zip yolov5s.onnx是我下载官方的onnx模型,yolov5s_pt2onnx.onnx是我用官方的yolov5s.pt使用python3 export.py --weights yolov5s_pt2onnx.pt --include onnx --img 320生成的。其中yolov5s_pt2onnx.onnx出现是的错误是上面提到的, yolov5s.onnx出现的错误如下
root@RSH-NUC0021:~/k230/k230_sdk-main/src/big/nncase/my_example# python onnx2kmodel.py --target k230 --model yolov5/yolov5s.onnx --dataset calibration_dataset/
warn: Nncase.Hosting.PluginLoader[0]
NNCASE_PLUGIN_PATH is not set.
/root/k230/k230_sdk-main/src/big/nncase/my_example/onnx2kmodel.py:23: 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]
WARNING: The argument `input_shapes` is deprecated. Please use `overwrite_input_shapes` and/or `test_input_shapes` instead. An error will be raised in the future.
Process terminated. Assertion Failed
at Nncase.Passes.RewriteProvider.Rewrite(Expr expr, IEnumerable`1 rules, RunPassContext context)
at Nncase.CompilerServicesProvider.Rewrite(Expr expr, IEnumerable`1 rules, RunPassContext options)
at Nncase.CompilerServices.Rewrite(Expr expr, IEnumerable`1 rules, RunPassContext options)
at Nncase.Passes.DataflowPass.RunCoreAsync(BaseFunction function, RunPassContext options)
at Nncase.Passes.Pass`2.RunAsync(TInput input, RunPassContext context)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Nncase.Passes.Pass`2.RunAsync(TInput input, RunPassContext context)
at Nncase.Passes.PassManager.FunctionPassGroup.Runner.RunAsync()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Nncase.Passes.PassManager.FunctionPassGroup.Runner.RunAsync()
at Nncase.Passes.PassManager.FunctionPassGroup.RunAsync(IRModule module)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Nncase.Passes.PassManager.FunctionPassGroup.RunAsync(IRModule module)
at Nncase.Passes.PassManager.RunAsync(IRModule module)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Nncase.Passes.PassManager.RunAsync(IRModule module)
at Nncase.Compiler.Compiler.RunPassAsync(Action`1 register, String name)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Nncase.Compiler.Compiler.RunPassAsync(Action`1 register, String name)
at Nncase.Compiler.Compiler.CompileAsync()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Nncase.Compiler.Compiler.CompileAsync()
at Nncase.Compiler.Interop.CApi.CompilerCompile(IntPtr compilerHandle)
Aborted
@wozwdaqian yolov5s.onnx 中存在float16类型不支持的情况 yolov5s_pt2onnx.onnx 的问题已经修复
Describe the bug nncase2.2版本yolov5-7.0的s模型 onnx转kmodel失败
To Reproduce 运行下面代码会出现这个错误
Expected behavior 成功转模型
Origin model and code 这是我用于转模型的代码,k230_sdk中提供的yolov5s.onnx是可以正常转的,但是官方7.0版本不行,我测试了不进行量化也是可以转模型成功。
Environment (please complete the following information):