Deploying YOLOv8 to ARTPEC-8 cameras #144
-
Can ARTPEC-8 cameras run YOLOv8?Could the Axis team please advise if ARTPEC-8 DLPU chips are able to support running int8 per-tensor quantized YOLOv8m? For reference our team is seeing model loading errors when attempting to load this model to the inference server leveraging the object_detector_python script, with these errors pointing to the model containing > max 16 graph partitions and certain operations not supported on ARTPEC-8 cameras (see docs for full overview of YOLOv8 architecture / layers), which we were curious to learn more about why this would break. Any pointers on this would be much appreciated if possible, thank you.
To reproduce
Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 11 replies
-
Hello @philippe-heitzmann Can you show the command that you used to run the export.py script and produce a tflite quantized per tensor? |
Beta Was this translation helpful? Give feedback.
-
Hi @Corallo yes definitely please see below for code used for exporting this YOLOv8m model, and link for the model weights outputted from the below:
As it seems the error message is indicating there are ~68 graph partitions with unsupported operations in the model graph, we were wondering if the Axis team could please advise if any intuition on which of these layers may be problematic in this case, especially in the context of previous reports such as #112 of YOLOv5s being able to run (albeit slowly) on ARPTEC-8 DLPU chips, given both of these v5 & v8 models would use mostly identical types of convolutions / operations etc. Any pointers on this would be much appreciated if possible, thank you. |
Beta Was this translation helpful? Give feedback.
-
Hello @philippe-heitzmann Running This seems to be a problem with onnx2tf, I am not sure if it has a flag to ask to quantize not only the filters, but also everything else. |
Beta Was this translation helpful? Give feedback.
-
@philippe-heitzmann
The model with the correct quantization is Let us know how that works, we would be happy to hear that you succeeded. |
Beta Was this translation helpful? Give feedback.
-
Hi Corallo. Thank you very much for your efforts. Then I converted it with your command: onnx2tf -i yolov7.onnx -oiqt -qt per-tensor -ioqd uint8 From the journactl of larod the log is more concise: EDIT: the same failure happens with yolov7-tiny |
Beta Was this translation helpful? Give feedback.
-
I'll move this to a discussion as it is not an issue with the examples. |
Beta Was this translation helpful? Give feedback.
-
Hi again, |
Beta Was this translation helpful? Give feedback.
Hello @philippe-heitzmann
Running
journalctl -u larod
after trying to load the model (and failing) gives you more info about the problem with the model.Specifically, running it after loading your model you'll see
Apr 13 11:17:43 axis-b8a44f277efe sh[1156]: ERROR: hybrid data type is not supported in conv2d.
This means that the conv2d are quantized only in the kernel parameters, but the convolution excepts input and produce outputs as float. This is not supported.
Besides, looking at your model with netron you can see that other layers are not quantized, like the Add and Mul nodes, this will make the execution fall back to the cpu after each convolution, and that's why you see that error s…