why yolov3 gave this error "Layer 'upsamsple1Detection2' does not exist"?

1 次查看(过去 30 天)
I download YOLO v3 from adds on in Mathwork page. However when I try to run the code to desgin the network using squeezenet network on Matlab 2020a it gave me this error "Layer 'upsamsple1Detection2' does not exist.". I attach the layer graph for last three steps.
Any help I will appreciate it.
%% Load the SqueezeNet network pretrained on Imagenet data set.
baseNetwork = squeezenet;
lgraph = squeezenetFeatureExtractor(baseNetwork, networkInputSize);
%% Then specify the class names, the number of object classes to detect,
% and number of prediction elements per anchor box, and add the detection
% heads to the feature extraction network
classNames = trainingDataTbl.Properties.VariableNames(2:end);
numClasses = size(classNames, 2);
numPredictorsPerAnchor = 5 + numClasses;
%% add detection heads first and second
lgraph = addFirstDetectionHead(lgraph, anchorBoxMasks{1}, numPredictorsPerAnchor);
lgraph = addSecondDetectionHead(lgraph, anchorBoxMasks{2}, numPredictorsPerAnchor);
%% Finally, connect the detection heads by connecting the first detection
% head to the feature extraction layer and the second detection head
% to the output of the first detection head.
lgraph = connectLayers(lgraph, 'fire9-concat', 'conv1Detection1');
lgraph = connectLayers(lgraph,'relu1Detection1','upsamsple1Detection2');
lgraph = connectLayers(lgraph,'fire5-concat','depthConcat1Detection22/in2');
analyzeNetwork (lgraph)

回答(1 个)

Aneela
Aneela 2024-4-1
Hi N. White,
The error "Layer 'upsamsple1Detection2' does not exist" you are facing suggests that there is no “upsamsple1Detection2” layer in the network.
  • This can be due to an issue with naming of layers in the code.
  • Ensure that the layer you're trying to connect exists in the “lgraph” and its name is correctly spelled.
It seems like there might be a typo in the layer name “upsamsple1Detection2.”
The correct name is “upsample1Detection2” according to the layer graph YOLOv3lgraph1.PNG .

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by