TrainNetwork bug for 3D CNN

13 vues (au cours des 30 derniers jours)
Duman
Duman le 28 Juin 2019
Commenté : Duman le 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

Réponses (2)

cui,xingxing
cui,xingxing le 12 Août 2019
Modifié(e) : cui,xingxing le 13 Août 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 le 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 commentaire
Duman
Duman le 20 Nov 2019
Yes, that is right. I already used another CNN network without "crossChannelNormalizationLayer".
Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by