TrainNetwork bug for 3D CNN
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (2)
cui,xingxing
el 12 de Ag. de 2019
Editada: cui,xingxing
el 13 de Ag. de 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!
0 comentarios
Amir Ebrahimi
el 20 de Nov. de 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.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!