Open ilichev-andrey opened 7 years ago
From the size of your dataset, I assume that you are fine-tuning with changing the last layer only, so try with lower learning rate as the default 0.1 would be too high in this case, also try with setting the learning rate decay.
I run:
th main.lua -depth 18 -batchSize 24 -data [path to dataset]
changed:
model:add(nn.Linear(nFeatures, 1000)) -> model:add(nn.Linear(nFeatures, 1046))
in https://github.com/facebook/fb.resnet.torch/blob/master/models/resnet.lua#L128
I did not do so:
th main.lua -retrain resnet-18.t7 -data [path-to-directory-with-train-and-val] -resetClassifier true -nClasses 1046
Start with learning rate 0.01? what will increase or decrease: -weightDecay', 1e-4, 'weight decay'? How much weight decay should I choose?
Thanks.
By running this command, you are training the model from scratch on much smaller dataset than imagenet, so you will not reach the same performance, and with this size your model will most likely overfit the training set.
I recommend that you yo do fine-tuning instead.
1- model:add(nn.Linear(nFeatures, 1000)) -> model:add(nn.Linear(nFeatures, 1046))
2- th main.lua -retrain resnet-18.t7 -data [path-to-directory-with-train-and-val] -resetClassifier true -nClasses 1046 -LR 0.001
Thanks, I will try.
How did the training go? @ilichev-andrey Were you able to solve your problem?
Yes, it really works. For 3 epochs I have reached a mistake in less than 90 epochs.
epoch: 10, top 1: 37.635, top 5: 15.321
Hello.
Single-crop (224x224) validation error rate:
My validation error:
I used imageNet 1046 classes: 1000 classes - default imageNet 2012 46 classes - my classes
dataset:
Please tell me why I was not able to achieve the specified accuracy?