Error in YOLO v3 example code when attempting to train

21 views (last 30 days)
Yonathan Zarkovian
Yonathan Zarkovian on 28 Oct 2021
Commented: saiqa jutt on 1 Mar 2022
Hi,
While running the code from this example, but with doTraining set to true, I get the following errors. I'd appreciate your help.
'generateTargets' is used in Object Detection Using YOLO v3 Deep Learning.
Error in modelGradients (line 11)
[boxTarget, objectnessTarget, classTarget, objectMaskTarget, boxErrorScale] = generateTargets(gatheredPredictions,...
Error in deep.internal.dlfeval (line 18)
[varargout{1:nout}] = fun(x{:});
Error in dlfeval (line 41)
[varargout{1:nout}] = deep.internal.dlfeval(fun,varargin{:});
Error in yolov3_Copy (line 110)
[gradients, state, lossInfo] = dlfeval(@modelGradients, yolov3Detector, XTrain, YTrain, penaltyThreshold);

Answers (1)

Anshika Chaurasia
Anshika Chaurasia on 2 Nov 2021
Hi,
On opening the example using following command in MATLAB window:
openExample('deeplearning_shared/ObjectDetectionUsingYOLOV3DeepLearningExample')
There is no error while training the network from the default location.
But if the ObjectDetectionUsingYOLOV3DeepLearningExample.mlx file is copied and run from some different location then it throws error as you have mentioned.
The solution to error is that on copying the ObjectDetectionUsingYOLOV3DeepLearningExample.mlx file, also copy all the files available in left side in current folder as shown below:
There is a file generateTargets.m which is missing while you are running the yolov2_Copy file and hence got the error.
Refer to documentaton for more information about supporting functions for object detection using YoloV3 Deep Learning.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by