wiki-documents icon indicating copy to clipboard operation
wiki-documents copied to clipboard

Error converting ONNX following the example

Open webfrank opened this issue 10 months ago • 12 comments

I've followed the example in the documentation, trying to convert the provided yolo11n.onnx to cvimodel for seeedstudio recamera

root@60b080763dad:/workspace# model_deploy \                                                                                                                                                   --mlir yolo11n.mlir \                                                                                                                                                                        --quant_input \                                                                                                                                                                              --quantize F16 \
  --customization_format RGB_PACKED \
  --processor cv181x \
  --test_input car.jpg \
  --test_reference yolo11n_top_outputs.npz \
  --fuse_preprocess \
  --tolerance 0.99,0.9 \
  --model yolo11n_1684x_f16.cvimodel
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2025/02/19 15:50:30 - INFO : TPU-MLIR v1.15.1-20250208
2025/02/19 15:50:30 - INFO : 
  load_config Preprocess args : 
        resize_dims           : [640, 640]
        keep_aspect_ratio     : True
        keep_ratio_mode       : letterbox
        pad_value             : 0
        pad_type              : center
        input_dims            : [640, 640]
        --------------------------
        mean                  : [0.0, 0.0, 0.0]
        scale                 : [0.0039216, 0.0039216, 0.0039216]
        --------------------------
        pixel_format          : rgb
        channel_format        : nchw

2025/02/19 15:50:30 - INFO : Add preprocess, set the following params:
2025/02/19 15:50:30 - INFO : 
         _____________________________________________________ 
        | preprocess:                                           |
        |   (x - mean) * scale                                  |
        '-------------------------------------------------------'
  config Preprocess args : 
        resize_dims           : [640, 640]
        keep_aspect_ratio     : True
        keep_ratio_mode       : letterbox
        pad_value             : 0
        pad_type              : center
        --------------------------
        mean                  : [0.0, 0.0, 0.0]
        scale                 : [1.0, 1.0, 1.0]
        --------------------------
        pixel_format          : rgb
        channel_format        : nhwc

[Running]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
ConvertUpsampleOp : top.Upsample succeed!
ConvertUpsampleOp : top.Upsample succeed!
Entering FusePreprocessPass.
raw format not support current type
UNREACHABLE executed at /__w/tpu-mlir/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/Preprocess.cpp:108!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: tpuc-opt yolo11n.mlir --init "--processor-assign=chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize "--fuse-preprocess=mode=F16 customization_format=RGB_PACKED align=False" "--convert-top-to-tpu= asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o yolo11n_cv181x_f16_tpu.mlir
 #0 0x000055b3dfaaf467 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884467)
 #1 0x000055b3dfaad18e (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x88218e)
 #2 0x000055b3dfaafdea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884dea)
 #3 0x00007afc29347520 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42520)
 #4 0x00007afc2939b9fc pthread_kill (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x969fc)
 #5 0x00007afc29347476 gsignal (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42476)
 #6 0x00007afc2932d7f3 abort (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x287f3)
 #7 0x000055b3dfaacfb1 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x881fb1)
 #8 0x000055b3dff00850 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xcd5850)
 #9 0x000055b3dfd5d656 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb32656)
#10 0x000055b3dfd5cf34 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb31f34)
#11 0x000055b3e10ee337 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ec3337)
#12 0x000055b3e10eac4f (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ebfc4f)
#13 0x000055b3e10b3d2c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e88d2c)
#14 0x000055b3e10b0b7c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e85b7c)
#15 0x000055b3dfc0b394 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x9e0394)
#16 0x000055b3e1117624 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eec624)
#17 0x000055b3e1117c51 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eecc51)
#18 0x000055b3e111a0f8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eef0f8)
#19 0x000055b3dfaa0b1b (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x875b1b)
#20 0x000055b3dfa9fee4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x874ee4)
#21 0x000055b3e1334ac8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x2109ac8)
#22 0x000055b3dfa9a1ea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f1ea)
#23 0x000055b3dfa9a6b4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f6b4)
#24 0x000055b3dfa990fa (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86e0fa)
#25 0x00007afc2932ed90 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29d90)
#26 0x00007afc2932ee40 __libc_start_main (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29e40)
#27 0x000055b3dfa98505 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86d505)
Aborted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 556, in <module>
    lowering_patterns = tool.lowering()
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 200, in lowering
    patterns = mlir_lowering(
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 559, in mlir_lowering
    _os_system(cmd, mute=mute,log_level=log_level)
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 420, in _os_system
    raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
root@60b080763dad:/workspace# 

webfrank avatar Feb 19 '25 07:02 webfrank

👋 @webfrank

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.

github-actions[bot] avatar Feb 19 '25 07:02 github-actions[bot]

could u plz show me your ONNX information of IR Version?

Image

jjjadand avatar Feb 19 '25 09:02 jjjadand

And your command seems to lack some parameters. Image

I've followed the example in the documentation, trying to convert the provided yolo11n.onnx to cvimodel for seeedstudio recamera

root@60b080763dad:/workspace# model_deploy \                                                                                                                                                   --mlir yolo11n.mlir \                                                                                                                                                                        --quant_input \                                                                                                                                                                              --quantize F16 \
  --customization_format RGB_PACKED \
  --processor cv181x \
  --test_input car.jpg \
  --test_reference yolo11n_top_outputs.npz \
  --fuse_preprocess \
  --tolerance 0.99,0.9 \
  --model yolo11n_1684x_f16.cvimodel
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2025/02/19 15:50:30 - INFO : TPU-MLIR v1.15.1-20250208
2025/02/19 15:50:30 - INFO : 
  load_config Preprocess args : 
        resize_dims           : [640, 640]
        keep_aspect_ratio     : True
        keep_ratio_mode       : letterbox
        pad_value             : 0
        pad_type              : center
        input_dims            : [640, 640]
        --------------------------
        mean                  : [0.0, 0.0, 0.0]
        scale                 : [0.0039216, 0.0039216, 0.0039216]
        --------------------------
        pixel_format          : rgb
        channel_format        : nchw

2025/02/19 15:50:30 - INFO : Add preprocess, set the following params:
2025/02/19 15:50:30 - INFO : 
         _____________________________________________________ 
        | preprocess:                                           |
        |   (x - mean) * scale                                  |
        '-------------------------------------------------------'
  config Preprocess args : 
        resize_dims           : [640, 640]
        keep_aspect_ratio     : True
        keep_ratio_mode       : letterbox
        pad_value             : 0
        pad_type              : center
        --------------------------
        mean                  : [0.0, 0.0, 0.0]
        scale                 : [1.0, 1.0, 1.0]
        --------------------------
        pixel_format          : rgb
        channel_format        : nhwc

[Running]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
ConvertUpsampleOp : top.Upsample succeed!
ConvertUpsampleOp : top.Upsample succeed!
Entering FusePreprocessPass.
raw format not support current type
UNREACHABLE executed at /__w/tpu-mlir/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/Preprocess.cpp:108!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: tpuc-opt yolo11n.mlir --init "--processor-assign=chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize "--fuse-preprocess=mode=F16 customization_format=RGB_PACKED align=False" "--convert-top-to-tpu= asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o yolo11n_cv181x_f16_tpu.mlir
 #0 0x000055b3dfaaf467 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884467)
 #1 0x000055b3dfaad18e (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x88218e)
 #2 0x000055b3dfaafdea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884dea)
 #3 0x00007afc29347520 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42520)
 #4 0x00007afc2939b9fc pthread_kill (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x969fc)
 #5 0x00007afc29347476 gsignal (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42476)
 #6 0x00007afc2932d7f3 abort (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x287f3)
 #7 0x000055b3dfaacfb1 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x881fb1)
 #8 0x000055b3dff00850 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xcd5850)
 #9 0x000055b3dfd5d656 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb32656)
#10 0x000055b3dfd5cf34 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb31f34)
#11 0x000055b3e10ee337 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ec3337)
#12 0x000055b3e10eac4f (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ebfc4f)
#13 0x000055b3e10b3d2c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e88d2c)
#14 0x000055b3e10b0b7c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e85b7c)
#15 0x000055b3dfc0b394 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x9e0394)
#16 0x000055b3e1117624 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eec624)
#17 0x000055b3e1117c51 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eecc51)
#18 0x000055b3e111a0f8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eef0f8)
#19 0x000055b3dfaa0b1b (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x875b1b)
#20 0x000055b3dfa9fee4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x874ee4)
#21 0x000055b3e1334ac8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x2109ac8)
#22 0x000055b3dfa9a1ea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f1ea)
#23 0x000055b3dfa9a6b4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f6b4)
#24 0x000055b3dfa990fa (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86e0fa)
#25 0x00007afc2932ed90 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29d90)
#26 0x00007afc2932ee40 __libc_start_main (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29e40)
#27 0x000055b3dfa98505 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86d505)
Aborted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 556, in <module>
    lowering_patterns = tool.lowering()
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 200, in lowering
    patterns = mlir_lowering(
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 559, in mlir_lowering
    _os_system(cmd, mute=mute,log_level=log_level)
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 420, in _os_system
    raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
root@60b080763dad:/workspace# 

Your command seems to lack some parameters.

Image

jjjadand avatar Feb 19 '25 09:02 jjjadand

Model is in the required version

Image

Full commands are:

pip install tpu_mlir[onnx]

model_transform \
  --model_name alpr \
  --model_def anpr-demo-model.onnx \
  --input_shapes "[[1,3,640,640]]" \
  --mean "0.0,0.0,0.0" \
  --scale "0.0039216,0.0039216,0.0039216" \
  --keep_aspect_ratio \
  --pixel_format rgb \
  --output_names "/model.23/cv2.0/cv2.0.2/Conv_output_0,/model.23/cv3.0/cv3.0.2/Conv_output_0,/model.23/cv2.1/cv2.1.2/Conv_output_0,/model.23/cv3.1/cv3.1.2/Conv_output_0,/model.23/cv2.2/cv2.2.2/Conv_output_0,/model.23/cv3.2/cv3.2.2/Conv_output_0" \
  --test_input car.png \
  --test_result alpr_top_outputs.npz \
  --mlir alpr.mlir

The final output is

min_similiarity = (0.9999995231628418, 0.9999982078713782, 114.61116790771484)
Target    alpr_top_outputs.npz
Reference alpr_ref_outputs.npz
npz compare PASSED.
compare /model.23/cv3.2/cv3.2.2/Conv_output_0_Conv: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 230/230 [00:22<00:00, 10.39it/s]
[Success]: npz_tool.py compare alpr_top_outputs.npz alpr_ref_outputs.npz --tolerance 0.99,0.99 --except - -vv
model_deploy \
  --mlir alpr.mlir \
  --quant_input \
  --customization_format RGB_PACKED \
  --quantize F16 \
  --processor cv181x \
  --test_input car.png \
  --test_reference alpr_top_outputs.npz \
  --fuse_preprocess \
  --tolerance 0.99,0.99 \
  --model alpr.cvimodel

and the error is the same

ConvertUpsampleOp : top.Upsample succeed!
Entering FusePreprocessPass.
raw format not support current type
UNREACHABLE executed at /__w/tpu-mlir/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/Preprocess.cpp:108!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: tpuc-opt alpr.mlir --init "--processor-assign=chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize "--fuse-preprocess=mode=F16 customization_format=RGB_PACKED align=False" "--convert-top-to-tpu= asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o alpr_cv181x_f16_tpu.mlir
 #0 0x00005f0ed2b50467 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884467)
 #1 0x00005f0ed2b4e18e (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x88218e)
 #2 0x00005f0ed2b50dea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884dea)
 #3 0x0000781cf1788520 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42520)
 #4 0x0000781cf17dc9fc pthread_kill (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x969fc)
 #5 0x0000781cf1788476 gsignal (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42476)
 #6 0x0000781cf176e7f3 abort (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x287f3)
 #7 0x00005f0ed2b4dfb1 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x881fb1)
 #8 0x00005f0ed2fa1850 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xcd5850)
 #9 0x00005f0ed2dfe656 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb32656)
#10 0x00005f0ed2dfdf34 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb31f34)
#11 0x00005f0ed418f337 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ec3337)
#12 0x00005f0ed418bc4f (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ebfc4f)
#13 0x00005f0ed4154d2c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e88d2c)
#14 0x00005f0ed4151b7c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e85b7c)
#15 0x00005f0ed2cac394 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x9e0394)
#16 0x00005f0ed41b8624 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eec624)
#17 0x00005f0ed41b8c51 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eecc51)
#18 0x00005f0ed41bb0f8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eef0f8)
#19 0x00005f0ed2b41b1b (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x875b1b)
#20 0x00005f0ed2b40ee4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x874ee4)
#21 0x00005f0ed43d5ac8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x2109ac8)
#22 0x00005f0ed2b3b1ea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f1ea)
#23 0x00005f0ed2b3b6b4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f6b4)
#24 0x00005f0ed2b3a0fa (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86e0fa)
#25 0x0000781cf176fd90 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29d90)
#26 0x0000781cf176fe40 __libc_start_main (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29e40)
#27 0x00005f0ed2b39505 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86d505)
Aborted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 556, in <module>
    lowering_patterns = tool.lowering()
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 200, in lowering
    patterns = mlir_lowering(
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 559, in mlir_lowering
    _os_system(cmd, mute=mute,log_level=log_level)
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 420, in _os_system
    raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt alpr.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o alpr_cv181x_f16_tpu.mlir

I tried also with the suggested yolo11n.onnx but results are the same. Tested with docker image 3.1, 3.2 and 3.3

webfrank avatar Feb 20 '25 07:02 webfrank

Model is in the required version

Image Full commands are:

pip install tpu_mlir[onnx]

model_transform \
  --model_name alpr \
  --model_def anpr-demo-model.onnx \
  --input_shapes "[[1,3,640,640]]" \
  --mean "0.0,0.0,0.0" \
  --scale "0.0039216,0.0039216,0.0039216" \
  --keep_aspect_ratio \
  --pixel_format rgb \
  --output_names "/model.23/cv2.0/cv2.0.2/Conv_output_0,/model.23/cv3.0/cv3.0.2/Conv_output_0,/model.23/cv2.1/cv2.1.2/Conv_output_0,/model.23/cv3.1/cv3.1.2/Conv_output_0,/model.23/cv2.2/cv2.2.2/Conv_output_0,/model.23/cv3.2/cv3.2.2/Conv_output_0" \
  --test_input car.png \
  --test_result alpr_top_outputs.npz \
  --mlir alpr.mlir

The final output is

min_similiarity = (0.9999995231628418, 0.9999982078713782, 114.61116790771484)
Target    alpr_top_outputs.npz
Reference alpr_ref_outputs.npz
npz compare PASSED.
compare /model.23/cv3.2/cv3.2.2/Conv_output_0_Conv: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 230/230 [00:22<00:00, 10.39it/s]
[Success]: npz_tool.py compare alpr_top_outputs.npz alpr_ref_outputs.npz --tolerance 0.99,0.99 --except - -vv
model_deploy \
  --mlir alpr.mlir \
  --quant_input \
  --customization_format RGB_PACKED \
  --quantize F16 \
  --processor cv181x \
  --test_input car.png \
  --test_reference alpr_top_outputs.npz \
  --fuse_preprocess \
  --tolerance 0.99,0.99 \
  --model alpr.cvimodel

and the error is the same

ConvertUpsampleOp : top.Upsample succeed!
Entering FusePreprocessPass.
raw format not support current type
UNREACHABLE executed at /__w/tpu-mlir/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/Preprocess.cpp:108!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: tpuc-opt alpr.mlir --init "--processor-assign=chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize "--fuse-preprocess=mode=F16 customization_format=RGB_PACKED align=False" "--convert-top-to-tpu= asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o alpr_cv181x_f16_tpu.mlir
 #0 0x00005f0ed2b50467 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884467)
 #1 0x00005f0ed2b4e18e (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x88218e)
 #2 0x00005f0ed2b50dea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884dea)
 #3 0x0000781cf1788520 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42520)
 #4 0x0000781cf17dc9fc pthread_kill (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x969fc)
 #5 0x0000781cf1788476 gsignal (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42476)
 #6 0x0000781cf176e7f3 abort (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x287f3)
 #7 0x00005f0ed2b4dfb1 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x881fb1)
 #8 0x00005f0ed2fa1850 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xcd5850)
 #9 0x00005f0ed2dfe656 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb32656)
#10 0x00005f0ed2dfdf34 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb31f34)
#11 0x00005f0ed418f337 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ec3337)
#12 0x00005f0ed418bc4f (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ebfc4f)
#13 0x00005f0ed4154d2c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e88d2c)
#14 0x00005f0ed4151b7c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e85b7c)
#15 0x00005f0ed2cac394 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x9e0394)
#16 0x00005f0ed41b8624 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eec624)
#17 0x00005f0ed41b8c51 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eecc51)
#18 0x00005f0ed41bb0f8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eef0f8)
#19 0x00005f0ed2b41b1b (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x875b1b)
#20 0x00005f0ed2b40ee4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x874ee4)
#21 0x00005f0ed43d5ac8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x2109ac8)
#22 0x00005f0ed2b3b1ea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f1ea)
#23 0x00005f0ed2b3b6b4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f6b4)
#24 0x00005f0ed2b3a0fa (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86e0fa)
#25 0x0000781cf176fd90 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29d90)
#26 0x0000781cf176fe40 __libc_start_main (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29e40)
#27 0x00005f0ed2b39505 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86d505)
Aborted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 556, in <module>
    lowering_patterns = tool.lowering()
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 200, in lowering
    patterns = mlir_lowering(
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 559, in mlir_lowering
    _os_system(cmd, mute=mute,log_level=log_level)
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 420, in _os_system
    raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt alpr.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o alpr_cv181x_f16_tpu.mlir

I tried also with the suggested yolo11n.onnx but results are the same. Tested with docker image 3.1, 3.2 and 3.3

hi, frank. Could you shared your ONNX file with me? i will test it.

jjjadand avatar Feb 20 '25 07:02 jjjadand

Hi, I will upload it here, no problem, but the error is the same using the linked yolov11n.onnx

https://fastupload.io/71369425ce690b9a

webfrank avatar Feb 20 '25 18:02 webfrank

Hi, any news on this? Other users got the same issue. I bought the cam to be able to use a custom trained model, not the preloaded one. Without this it is just a cute paperweight. How did you converted the standard yolo11n.onnx to cvimodel? The described procedure does not work.

webfrank avatar Mar 02 '25 09:03 webfrank

Hi, any news on this? Other users got the same issue. I bought the cam to be able to use a custom trained model, not the preloaded one. Without this it is just a cute paperweight. How did you converted the standard yolo11n.onnx to cvimodel? The described procedure does not work.

Hi, frank. I have convert your onnx to F16 cvimodel successfully. you also failed using the ONNX provided by Wiki, so I think it might be due to --test_input parameter. If it still doesn't work, you can try removing the --test_input parameter.

Image

Image

jjjadand avatar Mar 02 '25 13:03 jjjadand

No go, removed --test_input

[Success]: tpuc-opt yolo11n_origin.mlir --shape-infer --canonicalize --extra-optimize -o yolo11n.mlir
2025/03/03 02:06:29 - INFO : Mlir file generated:yolo11n.mlir
root@25f2c35c9495:/workspace# model_deploy \
  --mlir yolo11n.mlir \
  --quant_input \
  --customization_format RGB_PACKED \
  --quantize F16 \
  --processor cv181x \
  --fuse_preprocess \
  --tolerance 0.99,0.99 \
  --model yolo11n.cvimodel
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2025/03/03 02:07:11 - INFO : TPU-MLIR v1.15.2-20250224
[Running]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
ConvertUpsampleOp : top.Upsample succeed!
ConvertUpsampleOp : top.Upsample succeed!
Entering FusePreprocessPass.
raw format not support current type
UNREACHABLE executed at /__w/tpu-mlir/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/Preprocess.cpp:108!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: tpuc-opt yolo11n.mlir --init "--processor-assign=chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize "--fuse-preprocess=mode=F16 customization_format=RGB_PACKED align=False" "--convert-top-to-tpu= asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o yolo11n_cv181x_f16_tpu.mlir
 #0 0x0000559f0802e467 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884467)
 #1 0x0000559f0802c18e (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x88218e)
 #2 0x0000559f0802edea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884dea)
 #3 0x000076dcca1f0520 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42520)
 #4 0x000076dcca2449fc pthread_kill (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x969fc)
 #5 0x000076dcca1f0476 gsignal (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42476)
 #6 0x000076dcca1d67f3 abort (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x287f3)
 #7 0x0000559f0802bfb1 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x881fb1)
 #8 0x0000559f0847f850 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xcd5850)
 #9 0x0000559f082dc656 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb32656)
#10 0x0000559f082dbf34 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb31f34)
#11 0x0000559f0966d337 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ec3337)
#12 0x0000559f09669c4f (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ebfc4f)
#13 0x0000559f09632d2c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e88d2c)
#14 0x0000559f0962fb7c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e85b7c)
#15 0x0000559f0818a394 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x9e0394)
#16 0x0000559f09696624 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eec624)
#17 0x0000559f09696c51 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eecc51)
#18 0x0000559f096990f8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eef0f8)
#19 0x0000559f0801fb1b (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x875b1b)
#20 0x0000559f0801eee4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x874ee4)
#21 0x0000559f098b3ac8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x2109ac8)
#22 0x0000559f080191ea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f1ea)
#23 0x0000559f080196b4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f6b4)
#24 0x0000559f080180fa (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86e0fa)
#25 0x000076dcca1d7d90 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29d90)
#26 0x000076dcca1d7e40 __libc_start_main (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29e40)
#27 0x0000559f08017505 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86d505)
Aborted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 556, in <module>
    lowering_patterns = tool.lowering()
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 200, in lowering
    patterns = mlir_lowering(
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 559, in mlir_lowering
    _os_system(cmd, mute=mute,log_level=log_level)
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 420, in _os_system
    raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
root@25f2c35c9495:/workspace# 

webfrank avatar Mar 02 '25 18:03 webfrank

No go, removed --test_input

[Success]: tpuc-opt yolo11n_origin.mlir --shape-infer --canonicalize --extra-optimize -o yolo11n.mlir
2025/03/03 02:06:29 - INFO : Mlir file generated:yolo11n.mlir
root@25f2c35c9495:/workspace# model_deploy \
  --mlir yolo11n.mlir \
  --quant_input \
  --customization_format RGB_PACKED \
  --quantize F16 \
  --processor cv181x \
  --fuse_preprocess \
  --tolerance 0.99,0.99 \
  --model yolo11n.cvimodel
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2025/03/03 02:07:11 - INFO : TPU-MLIR v1.15.2-20250224
[Running]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
ConvertUpsampleOp : top.Upsample succeed!
ConvertUpsampleOp : top.Upsample succeed!
Entering FusePreprocessPass.
raw format not support current type
UNREACHABLE executed at /__w/tpu-mlir/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/Preprocess.cpp:108!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: tpuc-opt yolo11n.mlir --init "--processor-assign=chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize "--fuse-preprocess=mode=F16 customization_format=RGB_PACKED align=False" "--convert-top-to-tpu= asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o yolo11n_cv181x_f16_tpu.mlir
 #0 0x0000559f0802e467 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884467)
 #1 0x0000559f0802c18e (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x88218e)
 #2 0x0000559f0802edea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x884dea)
 #3 0x000076dcca1f0520 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42520)
 #4 0x000076dcca2449fc pthread_kill (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x969fc)
 #5 0x000076dcca1f0476 gsignal (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x42476)
 #6 0x000076dcca1d67f3 abort (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x287f3)
 #7 0x0000559f0802bfb1 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x881fb1)
 #8 0x0000559f0847f850 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xcd5850)
 #9 0x0000559f082dc656 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb32656)
#10 0x0000559f082dbf34 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0xb31f34)
#11 0x0000559f0966d337 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ec3337)
#12 0x0000559f09669c4f (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1ebfc4f)
#13 0x0000559f09632d2c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e88d2c)
#14 0x0000559f0962fb7c (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1e85b7c)
#15 0x0000559f0818a394 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x9e0394)
#16 0x0000559f09696624 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eec624)
#17 0x0000559f09696c51 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eecc51)
#18 0x0000559f096990f8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x1eef0f8)
#19 0x0000559f0801fb1b (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x875b1b)
#20 0x0000559f0801eee4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x874ee4)
#21 0x0000559f098b3ac8 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x2109ac8)
#22 0x0000559f080191ea (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f1ea)
#23 0x0000559f080196b4 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86f6b4)
#24 0x0000559f080180fa (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86e0fa)
#25 0x000076dcca1d7d90 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29d90)
#26 0x000076dcca1d7e40 __libc_start_main (/usr/local/lib/python3.10/dist-packages/tpu_mlir/lib/third_party/libc.so.6+0x29e40)
#27 0x0000559f08017505 (/usr/local/lib/python3.10/dist-packages/tpu_mlir/bin/tpuc-opt+0x86d505)
Aborted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 556, in <module>
    lowering_patterns = tool.lowering()
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/tools/model_deploy.py", line 200, in lowering
    patterns = mlir_lowering(
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 559, in mlir_lowering
    _os_system(cmd, mute=mute,log_level=log_level)
  File "/usr/local/lib/python3.10/dist-packages/tpu_mlir/python/utils/mlir_shell.py", line 420, in _os_system
    raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt yolo11n.mlir --processor-assign="chip=cv181x mode=F16 num_device=1 num_core=1 addr_mode=auto high_precision=False" --processor-top-optimize --fuse-preprocess="mode=F16 customization_format=RGB_PACKED align=False" --convert-top-to-tpu=" asymmetric=False doWinograd=False q_group_size=0 matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo11n_cv181x_f16_tpu.mlir
root@25f2c35c9495:/workspace# 

Try to downgrade the toolchain version? pip install tpu_mlir[onnx]==1.14

jjjadand avatar Mar 03 '25 02:03 jjjadand

Hi, it worked with the suggested version of tpu_mlir and removing test_input from deploy command.

Can you update documentation until a new release will fix the error?

webfrank avatar Mar 04 '25 07:03 webfrank

Hi, it worked with the suggested version of tpu_mlir and removing test_input from deploy command.

Can you update documentation until a new release will fix the error?

yes, we have updated the wiki. Before fixing the bug, 1.14 version is recommend,

jjjadand avatar Mar 12 '25 02:03 jjjadand

✅ @webfrank

This issue is closed, If you have any questions, you can comment and reply.

github-actions[bot] avatar Jul 18 '25 02:07 github-actions[bot]