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
26 stars 3 forks source link

Could not load 'yolov8x.mat' correctly (model not Initialized). #4

Open cenerd opened 5 months ago

cenerd commented 5 months ago

When the file 'yolov8x.mat' was downloaded and placed in the same directory with ' yolov8n.mat', I tried to load the v8x.mat file as did to v8n.mat. No error messege shown. However, when I double clicked the variable 'det' (det = data.yolov8Net) in the workspace, it showed empty attributes and det.Initialized is 0. While for v8n.mat, it shows 231x1 Layers, and det.Initialized is 1.

When '[bboxes, scores, labelIds] = detectYOLOv8(det, I, numClasses, executionEnvironment); ' was called as presented in the README.md, matlab produce the following error messege (in Chinese):

此类型的变量不支持使用点进行索引。 出错 dlnetwork/get.Layers (第 250 行) internalLayers(this.TopologicalOrder) = iRevertFunctional(this.PrivateNetwork.OriginalLayers); 出错 detectYOLOv8 (第 20 行) inputSize = dlnet.Layers(1).InputSize; 出错 main (第 32 行) [bboxes, scores, labelIds] = detectYOLOv8(det, I, numClasses, executionEnvironment);

viakkala commented 5 months ago

The error message you encountered suggests that the model has not been loaded, leading to the message "Variables of this type do not support indexing with dots." This is because the YOLO v8 variable hasn't been loaded in your case. You mentioned successfully loading v8x.mat without any error messages. Did you encounter any warning messages during this process?

Could you try running runInference.m from the main directory, but replace 'yolov8n' with 'yolov8x' on line 11?

Additionally, could you specify which version of MATLAB you are using?