Problem with training my network used for transfer learning.

2 Ansichten (letzte 30 Tage)
Rahul MYS
Rahul MYS am 14 Jun. 2019
Kommentiert: satinder nagra am 22 Feb. 2021
Hi, I am using matlab 2018b version to perform transfer learning using a pretrained neural net. I am using alexnet as a pretrained network. I removed the last threee layers and added a fully connected layer and a softmax and a classification layer. I initiated weightLearnFactor and biasLearnFactor of my fc layer. I randomized my dataset and augmented the images and did everything according to the code i referred on matlab page- https://in.mathworks.com/help/deeplearning/examples/transfer-learning-using-alexnet.html . Everything seems to work fine and training is done on my laptop with 96.01% accuracy. The network I trained with my dataset is the transferred network and not alexnet. i.e. layers = [
layersTransfer
fullyConnectedLayer(numClasses,'WeightLearnRateFactor',20,'BiasLearnRateFactor',20)
softmaxLayer
classificationLayer];
This layers is what I have trained on my dataset using command - netTransfer = trainNetwork(augimdsTrain,layers,options); I have not used a coomand to train alexnet.i.e. i have not performed - netTransfer = trainNetwork(augimdsTrain,net,options); (I initialized net as alexnet); So,I expect every layer of layers must have updated its weights and biases after training and would be different from the weights and biases of alexnet. Well, this is not the output that i observed. As I look into the weights of my newly added fullyConnectedLayer, its weights and biases, which were empty arrays before training remained empty i.e. weights and biases of my netwrok layers were not updated during training. I assured this again by using deepDreamImage. I can only see the images of a trained alexnet's layers and not my retrained layers's layers.So, why is my net not getting trained. I cannot create a neural net using layers using command assembleNetwork, as it says zero weights and biases in fc layer as an error. How do I get to train my new network layers.

Antworten (0)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by