YOLOv8n OpenCV VIM4 Demo - 2

Which system do you use? Android, Ubuntu, OOWOW or others?

I use Ubuntu Gnome 5.15

Which version of system do you use? Khadas official images, self built images, or others?

I use Khadas official image

Please describe your issue below:

I’m trying to launch this demo:
https://docs.khadas.com/products/sbc/vim4/npu/demos/yolov8n
I took yolov8n.pt from github repo and trying to convert it to .alga.
I converted it to onnx, after I sent onnx to docker container and launched convert, but get this error:
E Layer weight shape (3, 3, 3, 16) not compatible with provided weight shape (8400, 2, 1)

Post a console log of your issue below:

...***There is a big log***...
.
.
.
I Parse layer @Add...
I Process add_layer[291] @divide
I Parse layer @Div...
I Process add_layer[292] @subtract
I Parse layer @Sub...
I Process add_layer[293] @concatenate
I Parse layer @Concat...
I Process add_layer[294] @multiply
I Parse layer @Mul...
I Process add_layer[295] @sigmoid
I Parse layer @Sigmoid...
I Process add_layer[296] @concatenate
I Parse layer @Concat...
I Process add_output:concatenate_30
I Output_config outname:concatenate_30, shape:(1, 84, 8400)
I Process set_params begin!
I Process set_params param num:3, layer:conv2d
E Layer weight shape (3, 3, 3, 16) not compatible with provided weight shape (8400, 2, 1)
I ----------------Warning(0)----------------


Hello @Ivan_Zhukov ,

Could you provide your onnx model?

Hello @Louis-Cheng-Liu!
I could figure out with this problem. The problem was that I added method forward_export() to git-cloned ultralytics repo, and this doesn’t affect pt->onnx conversion process. Instead this I must add forward_export() to pip-installed ultralytics package, and after that everything works (but my VIM4 still reboots wnile detection as i described in Yolov7_tiny demo - #9 by Louis-Cheng-Liu).

I think it will be good if you add this tip in your instruction for people who aren’t python developers (like me =)).