Error in training 3D convolutional network

67 views
Skip to first unread message

curr...@gmail.com

unread,
Jan 11, 2019, 8:10:36 AM1/11/19
to mdCNN: Multidimensional CNN library in Matlab
Dear Hagay,
I'm trying to train a 3D convolutional neural network for a 600 samples [28x28x50] dataset. Before that, I tried the 3dMINST demo and it trained well, so I adapted the training settings for our dataset dimensions.
I got this error during the first iteration:



>> net   =  Train(Tactil3D,net, length(Tactil3D.I)*2 ); % 2 epocs
Dataset info - test: 120, train: 480, first sample size:=28  50  10, var=104.58, min=0.000000, max=126.000000
Verifying backProp..
Checking layer 1  - input       
Checking layer 2  - conv        
Checking layer 3  - conv        
Checking layer 4  - batchNorm   
Checking layer 5  - fc          
Checking layer 6  - fc          
Checking layer 7  - softmax     
Checking layer 8  - output      
Network is OK. Verification time=152.95
Start training on 960 samples (2.0 epocs, 96 batches, batchSize=10)
Iter 1  | samples=50   | time=4.28  | lossTrain=0.317025 | rmsErr=3.330522 | rmsGrad=0.015722 | meanWeight=0.087781 | varWeight=0.007647Reference to non-existent field 'minLoss'.

Error in Train (line 240)
    if (( net.runInfoParam.loss_test(end) <= net.runInfoParam.minLoss ) || ((exist('net_minM','var')==0)&&
    (net.runInfoParam.storeMinLossNet==1)))



I don't know how to solve this problem, could you help me?
By the way, here is my config file:



%%%%%%%%%%%%%%%%%%%%%  Layers specification %%%%%%%%%%%%%%%%%%

     net.layers{end+1}.properties = struct('type','input', 'sizeFm' ,[28 50 10],'numFm',1 );         %inputLayer
    net.layers{end+1}.properties = struct('type','conv','numFm',16  , 'Activation',@Relu, 'dActivation',@dRelu,'kernel',5,'pad',2, 'stride', [2 2 2], 'pooling', [1 1 1]);
%    net.layers{end+1}.properties = struct('type','batchNorm', 'initGamma',1, 'initBeta',0, 'alpha' , 2^-5 );
    net.layers{end+1}.properties = struct('type','conv','numFm',32 , 'kernel',[3 3 3]  ,'pad',[1 1 0], 'pooling', [1 1 1]);
    net.layers{end+1}.properties = struct('type','batchNorm'); % using defaults
    net.layers{end+1}.properties = struct('type','fc','numFm',128, 'dropOut' ,0.6);
    net.layers{end+1}.properties = struct('type','fc','numFm',10);
    net.layers{end+1}.properties = struct('type','softmax');
     net.layers{end+1}.properties = struct('type','output','lossFunc',@CrossEnt,'costFunc',@CrossEnt_Cost);     %output Layer - classification

%%%%%%%%%%%%%%%%%%%%%  Hyper params - training %%%%%%%%%%%%%%%%%%

    net.hyperParam.trainLoopCount = 48;        %on how many images to train before evaluating the network
    net.hyperParam.testImageNum   = 30;           % after each loop, on how many images to evaluate network performance
    net.hyperParam.ni_initial     = 0.01;        % ni to start training process
    net.hyperParam.ni_final       = 0.00001;        % final ni to stop the training process
    net.runInfoParam.verifyBP     = 1;
    net.hyperParam.noImprovementTh= 8;          % after how many iterations with no loss improvment to update ni
    net.hyperParam.normalizeNetworkInput = 1;   % will normalize every samples with mean 0, var=1 before passing to net

    net.hyperParam.batchNum=10;




Thank you in advance,
With kind regards,
Curro

Hagay Garty

unread,
Jan 11, 2019, 11:05:21 AM1/11/19
to mdCNN: Multidimensional CNN library in Matlab
Hi, in 'CreateNet' line 28 the minLoss variable is initialized, by the error you got it looks like this variable is not created.
I guess you have some local modification to 'CreateNet' function

Please try to take the latest code and call 'CreateNet' before using 'Train'

Hagay

curr...@gmail.com

unread,
Jan 11, 2019, 12:55:00 PM1/11/19
to mdCNN: Multidimensional CNN library in Matlab
Hello again, thanks for your quick response,

It looks like the version that i had was the one from the Matlab fileexchange (Matlab) and it isn´t the most updated one, becouse in 'CreateNet.m' line 28 the variable that was inicializated was minMSE instead of minLoss.

Now  that i downloaded the version from Github it actuallly works, i´m currently working on setting the parameters of the config file.

Thanks!
Reply all
Reply to author
Forward
0 new messages