Filter löschen
Filter löschen

Problem with convolutionUnit function

1 Ansicht (letzte 30 Tage)
Hind Haboubi
Hind Haboubi am 20 Apr. 2021
Beantwortet: Hiba elsaadayi am 8 Mär. 2024
Hello everyone, i wanted to creat a resnet 50 but i get this error:
Unrecognized function or variable
'convolutionalUnit'.
What should i do please?
netWidth = 16;
layers = [
imageInputLayer([224 224 3],'Name','input')
convolution2dLayer(3,netWidth,'Padding','same','Name','convInp')
batchNormalizationLayer('Name','BNInp')
reluLayer('Name','reluInp')
convolutionalUnit(netWidth,1,'S1U1')
additionLayer(2,'Name','add11')
reluLayer('Name','relu11')
convolutionalUnit(netWidth,1,'S1U2')
additionLayer(2,'Name','add12')
reluLayer('Name','relu12')
convolutionalUnit(2*netWidth,2,'S2U1')
additionLayer(2,'Name','add21')
reluLayer('Name','relu21')
convolutionalUnit(2*netWidth,1,'S2U2')
additionLayer(2,'Name','add22')
reluLayer('Name','relu22')
convolutionalUnit(4*netWidth,2,'S3U1')
additionLayer(2,'Name','add31')
reluLayer('Name','relu31')
convolutionalUnit(4*netWidth,1,'S3U2')
additionLayer(2,'Name','add32')
reluLayer('Name','relu32')
averagePooling2dLayer(8,'Name','globalPool')
fullyConnectedLayer(2,'Name','fcFinal')
softmaxLayer('Name','softmax')
classificationLayer('Name','classoutput')
];

Akzeptierte Antwort

Abhishek Gupta
Abhishek Gupta am 23 Apr. 2021
Bearbeitet: Abhishek Gupta am 23 Apr. 2021
Hi,
You are getting this error because MATLAB doesn't recognize the 'convolutionalUnit' as the name of a function on the MATLAB path (see this for more details related to the error message). You can resolve this issue by adding the 'convolutionalUnit' function in your MATLAB path. You can find the code for this function in the documentation link below (just above the references section):-
For your convenience, I am also copy-pasting the code here: -
function layers = convolutionalUnit(numF,stride,tag)
layers = [
convolution2dLayer(3,numF,'Padding','same','Stride',stride,'Name',[tag,'conv1'])
batchNormalizationLayer('Name',[tag,'BN1'])
reluLayer('Name',[tag,'relu1'])
convolution2dLayer(3,numF,'Padding','same','Name',[tag,'conv2'])
batchNormalizationLayer('Name',[tag,'BN2'])];
end
  2 Kommentare
Hind Haboubi
Hind Haboubi am 23 Apr. 2021
Thank you
Hiba elsaadayi
Hiba elsaadayi am 8 Mär. 2024
Hello, how to install deep learning algorithms on MATLAB. Note that they were downloaded on MATLAB but an error appears in the implementation. What do you think should be done?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Hiba elsaadayi
Hiba elsaadayi am 8 Mär. 2024
What is the code and steps for the algorithms to change them, build them, and train them by me and they are not ready?

Kategorien

Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by