DrCoffey / DeepSqueak

DeepSqueak v3: Using Machine Vision to Accelerate Bioacoustics Research
BSD 3-Clause "New" or "Revised" License
372 stars 89 forks source link

Network Training Problem #54

Closed rgunsay closed 4 years ago

rgunsay commented 5 years ago

Dear Kevin and Russell,

I have been trying to train the existing all short calls network with the manually isolated ultrasonic vocalizations of mice. However, I am encountering the following error when I try the training option:

Error using nnet.cnn.LayerGraph>iValidateInputsOfNewAndOldLayer (line 834)
Layer 'proposalLayer' has 2 connected inputs, but its replacement has 0 inputs.

Error in nnet.cnn.LayerGraph/replaceLayer (line 405)
            iValidateInputsOfNewAndOldLayer( larray(1), layerToReplace, ...

Error in vision.internal.cnn.RCNNLayers.splitFasterIntoFastAndRPN (line 1424)
            frcnn = frcnn.replaceLayer(proposalName,roiInput);

Error in fasterRCNNObjectDetector/getNetworksForAlternateTraining (line 1024)
                [frcnn,rpn,info] = vision.internal.cnn.RCNNLayers.splitFasterIntoFastAndRPN(lgraph);

Error in trainFasterRCNNObjectDetector>iParseInputs (line 908)
        lgraph = network.getNetworksForAlternateTraining();

Error in trainFasterRCNNObjectDetector (line 330)
[options, params] = iParseInputs(...

Error in TrainSqueakDetector (line 61)
detector = trainFasterRCNNObjectDetector(TrainingTables, layers, options, ...

Error in trainnew_Callback (line 39)
        [detector, layers, options] = TrainSqueakDetector(TrainingTables,detector);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in DeepSqueak (line 30)
    gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)DeepSqueak('trainnew_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating Menu Callback.

Screenshot from 2019-08-12 11_03_55 Screenshot from 2019-08-12 11_05_18 These are the training images.

Is the problem due to the version of MATLAB? I would be very grateful, if you have a look at the problem. Thank you in advance for your help. Linux / MATLAB 2019a

rgunsay commented 5 years ago

Hi again,

Have you had a chance at looking at the problem? Your answer would really help me proceed with the data analysis.

Best regards, Rauf

DrCoffey commented 5 years ago

Hey Rauf,

Sorry, I have been very busy writing a K99 and this slipped through the cracks. First, make sure you are using the most up to date vesion of DeepSqueak. Next, Mathworks has been screwing with the code for Faster-RCNN and so we only train new networks in Matlab 2018a. This might solve your problem, or it might be something specific to linux.

If you try again in 2018a, with the newest DeepSqueak, and you still get an error then post again.

It looks possible that the existing network you are trying to re-train has different options or layers then the new one. I'm not sure if we switched the layers or if Matlab changed how they work. I'll do some digging.

https://github.com/DrCoffey/DeepSqueak/wiki/training-detection-networks