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

how to use YOLOv8x? #2

Closed jihwan722 closed 8 months ago

jihwan722 commented 8 months ago

Other versions of YOLOv8 do not produce errors when running runinference.m. However, when I run the YOLOv8x version, I encounter the following error. Is there a way to solve this?

--error--

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 runInference (line 13) Warning: While loading an object of class 'nnet.cnn.LayerGraph': Array indices must be positive integers or logical values. In runInference (line 13) Warning: While loading an object of class 'dlnetwork': Error using dlnetwork Dot indexing is not supported for variables of this type.

Error in dlnetwork.loadobj (line 992) net = dlnetwork(in.LayerGraph, exampleInputs{:}, 'Initialize', in.Initialized);

Error in runInference (line 13) data = load('yolov8x.mat');

In runInference (line 13) Incorrect number or types of inputs or outputs for function getExternalLayers.

Error in dlnetwork/get.Layers (line 231) val = getExternalLayers(this.PrivateNetwork);

Error in detectYOLOv8 (line 20) inputSize = dlnet.Layers(1).InputSize;

Error in runInference (line 18) [bboxes, scores, labelIds] = detectYOLOv8(detector, I, numClasses, executionEnvironment);

anandy22 commented 8 months ago

Hi @jihwan722

I tried reproducing the error at my end. However, I was unable to do so.

Can you please help me with the following details: a. Your current MATLAB version? b. Your current Operating System? c. Output of your ver command.

jihwan722 commented 8 months ago

a. matlab 2023b update 7 b. win11 c. image

Additionally, the same error occurs in an environment using the same MATLAB version with Ubuntu 20.04 operating system and in an environment with MATLAB version 2022b on Windows 10.

viakkala commented 8 months ago

@jihwan722 Can you install "Deep Learning Toolbox Converter for ONNX Model Format" support package and try out the inference?

jihwan722 commented 8 months ago

@viakkala Thank you. It's working well now!!!