Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

按照官方操作手册转换yolo11模型出现问题

オープン
#208 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
ai, embedded-iot

調査の方向性

報告されたログを出発点として、ultralytics 8.4.52 と Pulsar2 6.0 または 7.0 を使用した YOLO11 の公式変換を再現する。yolo11n.npu.json、特に dst_perm と transpose_postprocess の失敗を調査し、その後、生成された出力形状を MaixPy の YOLO11 ローダーの想定と比較する。モデルが手動で JSON を編集せずに変換でき、MaixPy に正常にロードできれば完了とする。

索引モデルが issue の本文から書いたものです。

説明

环境:
python环境:
ultralytics 8.4.52

docker环境 两个版本同样错误
pulsar2 6.0
pulsar2 7.0

报错日志:
`2026-07-31 11:22:21.482 | INFO | yamain.command.precision_analysis:quant_precision_analysis:403 - save precision analysis table to [tmp/quant/debug/precision_analysis_table.txt]
2026-07-31 11:22:21.489 | INFO | yamain.command.precision_analysis:quant_precision_analysis:411 - save precision analysis graph to [tmp/quant/debug/precision_analysis.mmd]
Building native ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2026-07-31 11:22:22.667 | INFO | yamain.command.build:compile_ptq_model:1169 - group 0 compiler transformation
2026-07-31 11:22:22.676 | WARNING | yamain.command.load_model:pre_process:622 - preprocess tensor [images]
2026-07-31 11:22:22.676 | INFO | yamain.command.load_model:pre_process:624 - tensor: images, (1, 640, 640, 3), U8
2026-07-31 11:22:22.676 | INFO | yamain.command.load_model:pre_process:625 - op: op:pre_dequant_1, AxDequantizeLinear, {'const_inputs': {'x_zeropoint': array(0, dtype=int32), 'x_scale': array(1., dtype=float32)}, 'output_dtype': <class 'numpy.float32'>, 'quant_method': 0}
2026-07-31 11:22:22.676 | INFO | yamain.command.load_model:pre_process:624 - tensor: tensor:pre_norm_1, (1, 640, 640, 3), FP32
2026-07-31 11:22:22.676 | INFO | yamain.command.load_model:pre_process:625 - op: op:pre_norm_1, AxNormalize, {'dim': 3, 'mean': [0.0, 0.0, 0.0], 'std': [255.0, 255.0, 255.0], 'output_dtype': FP32}
2026-07-31 11:22:22.676 | INFO | yamain.command.load_model:pre_process:624 - tensor: tensor:pre_transpose_1, (1, 640, 640, 3), FP32
2026-07-31 11:22:22.676 | INFO | yamain.command.load_model:pre_process:625 - op: op:pre_transpose_1, AxTranspose, {'perm': [0, 3, 1, 2]}
2026-07-31 11:22:22.677 | WARNING | yamain.command.load_model:post_process:633 - postprocess tensor [/model.23/Concat_output_0]
Traceback (most recent call last):
File "", line 59, in guard_context
File "", line 1174, in compile_ptq_model
File "", line 782, in ir_compiler_transformation
File "", line 647, in post_process
File "", line 347, in transpose_postprocess
IndexError: list assignment index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 4, in
File "", line 281, in
File "", line 277, in pulsar2
File "", line 158, in wrapper
File "", line 21, in wrapper
File "", line 115, in build_error
File "", line 13, in wrapper
File "", line 625, in build
File "", line 1138, in compile_ptq_model
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "", line 61, in guard_context
File "", line 73, in error_func
yamain.common.error.CodeException: (<ErrorCode.FrontendError: 6>, IndexError('list assignment index out of range'))`

目前解决方案:
可以通过修改yolo11n.npu.json的方式来规避报错:
"dst_perm": [0, 1, 3, 2]“ 改为 "dst_perm": [0, 1, 2]"

生成的模型可以在板端推理,使用下面命令:
ax_run_model -m xxx.axmodel -r 100

但无法使用Maixpy 推理

报错:
`start running...

-- [I] [Maix Comm Protocol] auto set pinmap A21 to UART4_TX for uart4
-- [I] [Maix Comm Protocol] auto set pinmap A22 to UART4_RX for uart4
-- [I] [Maix Comm Protocol] listening on uart port: uart4(/dev/ttyS4)
-- [I] npu_ai_isp_on from config: 0 (off)
-- [I] init middleware SYSTEM
-- [I] maix multi-media driver used count: 1
-- [I] init middleware NPU ENGINE
-- [I] maix npu driver used count: 1
-- [I] load model from: /root/my_models/yolo11n_npu.axmodel
-- [I] input_cache : 1, flush input cache to ddr before run model: 0
-- [I] output_cache: 1, invalidate output cache after run model: 1
-- [I] model info:
type: yolo11
input type: rgb
mean:0.000000 0.000000 0.000000
scale:0.003922 0.003922 0.003922
labels num: 1
input size: 96x96

-- [E] output node shape error, please check 2
-- [I] Outputs:
LayerInfo(name='/model.23/Concat_output_0', dtype=float32, shape=[1, 64, 189])
LayerInfo(name='/model.23/Concat_1_output_0', dtype=float32, shape=[1, 1, 189])
LayerInfo(name='/model.23/Concat_2_output_0', dtype=float32, shape=[1, 4, 189])
Traceback (most recent call last):
File "/tmp/maixpy_run/main.py", line 4, in
detector = nn.YOLO11(model="/root/my_models/yolo11n.mud", dual_buff=True)
RuntimeError: Invalid arguments: load model failed`

主要言語
Python
スター
850
フォーク
128
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sipeed/MaixPy のほかの issue

sipeed/MaixPy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。