Clear Filters
Clear Filters

Error in YOLO v3 example code when attempting to train

4 views (last 30 days)
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 (2)

Anshika Chaurasia
Anshika Chaurasia on 2 Nov 2021
On opening the example using following command in MATLAB window:
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.

xy song
xy song on 7 Apr 2023
If you have the same question, you can try to update your software.
  1 Comment
xy song
xy song on 7 Apr 2023
the key is copying these two files called generateYOLOv3Detections.m and generateTargets.m into your workspace

Sign in to comment.




Community Treasure Hunt

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

Start Hunting!