matlab-deep-learning / Pretrained-YOLOv8-Network-For-Object-Detection

YOLO v8 training and inference in MATLAB for Object Detection with yolov8n, yolov8s, yolov8m, yolov8l, yolov8x, networks
https://in.mathworks.com/help/vision/ug/getting-started-with-object-detection-using-deep-learning.html
GNU Affero General Public License v3.0
30 stars 3 forks source link

Can't load yolov8x.mat #6

Closed ESSNIA closed 5 months ago

ESSNIA commented 5 months ago

Hello,

After I cloned the repo on my local disk, and added the 'models' subdirectory to my path I tried down/loading YOLOv8x like below:

modelName = 'yolov8x';
data = helper.downloadPretrainedYOLOv8(modelName);
det = data.yolov8Net;

The model downloads (seemingly) correctly as I get the 'Done. ' message. Then I get the following warnings and it results in the network not loading (empty values).

Warning: Unable to load instances of class nnet.onnx.layer.VerifyBatchSizeLayer into a heterogeneous array. The definition of
nnet.onnx.layer.VerifyBatchSizeLayer could be missing or contain an error. Default objects will be substituted. 
> In helper.downloadPretrainedYOLOv8 (line 23) 
Warning: While loading an object of class 'nnet.cnn.LayerGraph':
Array indices must be positive integers or logical values. 
> In helper.downloadPretrainedYOLOv8 (line 23) 
Warning: While loading an object of class 'dlnetwork':
Dot indexing is not supported for variables of this type.
Error in deep.internal.network.EditableNetwork (line 20)
                flowgraph.NodeModel = deep.internal.graph.flowgraph.EditableNetworkNodes(flowgraph.NodeModel);
Error in dlnetwork.loadobj (line 740)
                        privateNet = deep.internal.network.EditableNetwork(in.LayerGraph);
Error in helper.downloadPretrainedYOLOv8 (line 23)
model = load(netMatFileFullPath); 
> In helper.downloadPretrainedYOLOv8 (line 23) 

I tried downloading it directly through my web browser with the same result. I can't confirm if it is a possible corrupted download as there are no hashes (MD5 / SHA256) available AFAIK.

Doing the same works fine with all other model variants (nano, small, medium and large)

Any help would be appreciated.

viakkala commented 5 months ago

As mentioned in the requirements, can you please ensure "Deep Learning Toolbox Converter for ONNX Model Format" support package is installed?

ESSNIA commented 5 months ago

Thanks for your reply.

Indeed, always check the requirements first !

Thought I had it installed... I had not.

Works now!

Regards,