Filter löschen
Filter löschen

TrainNetwork bug for 3D CNN

3 Ansichten (letzte 30 Tage)
Duman
Duman am 28 Jun. 2019
Kommentiert: Duman am 20 Nov. 2019
I have a train data set with the size as follows:
size(X_train)= 512*512*14*1*200
size(Y_train)=200*1
I designed a 3D CNN network3D CNN network (3D convolution) and I am trying to train the designed 3D model using trainNetwork function:
[net, tr] = trainNetwork(X_train,Y_train,layers,options);
When the 'MiniBatchSize' is bigger than one (MiniBatchSize>1), I get the following Error:
Error using trainNetwork (line 165)
Invalid input array.
Caused by:
Error using builtin
Invalid input array.
But for 'MiniBatchSize of 1, it starts to train the model!
My designed network properties are as follows:
layers = [
image3dInputLayer([512 512 14 1],"Name","image3dinput")
convolution3dLayer([11 11 7],96,"Name","conv3d","BiasLearnRateFactor",2,"Padding",[1 1 1;1 1 1],"Stride",[4 4 7])
reluLayer("Name","relu1")
crossChannelNormalizationLayer(5,"Name","norm1","K",1)
averagePooling3dLayer([3 3 1],"Name","avgpool3d","Stride",[2 2 1])
fullyConnectedLayer(2,"Name","fc")
softmaxLayer("Name","softmax")
classificationLayer("Name","classoutput")];
options = trainingOptions('sgdm', ...
'MiniBatchSize',10, ...
'MaxEpochs',50, ...
'InitialLearnRate',3e-4, ...
'Shuffle','every-epoch', ...
'Plots','training-progress');
Can you please help me to solve this issue?
Thank you,
Dooman

Antworten (2)

cui,xingxing
cui,xingxing am 12 Aug. 2019
Bearbeitet: cui,xingxing am 13 Aug. 2019
if i set your "X_train , Y_train" like this:
X_train = zeros(320,320,16,3,200);
Y_train = categorical(randi(2,[200,1]));
and use your code can wok!
but i use my self custum datastore , can't work,why?

Amir Ebrahimi
Amir Ebrahimi am 20 Nov. 2019
As it seems, "crossChannelNormalizationLayer" does not work in 3D workflow in MATLAB 2019b. You may train your model with "MiniBatchSize"=1 but it is not correct anyway. Try to use other 3D models without "crossChannelNormalizationLayer". This bug is reported to Mathworks and they may fix it in future releases.
  1 Kommentar
Duman
Duman am 20 Nov. 2019
Yes, that is right. I already used another CNN network without "crossChannelNormalizationLayer".
Thanks

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by