Open gost-sniper opened 4 years ago
maybe you freeze '_fc' layers
I'm not suer about this issue. In general, EfficientNets are very hard to train. For future reference, make sure you can:
.extract_features
functionThen return to trying to train EfficientNet on your full dataset.
maybe you freeze '_fc' layers
No, I froze all but the '_fc' layer
Same. I used a different dataset, and also see accuracy being around the 25% range.
I'm also training with EfficientNet-B2 using the Places365_Standard dataset. I'm training _swish from the last block (_block.22) and freezing the rest of it. I'm currently at about 40% Acc1 in the validation data, any good advice on this issue?
@lukemelas's advice are very helpful try it out.
@gost-sniper @lukemelas In b2, the freeze layer was implemented with blocks 20, 21, 22 and the FC layer. As a result, the percentage of correct answers increased to nearly 55% in the Placese365 standard data. Accuracy was improved by the decay of lr at the 30, 60, and 90 timings.
@aporo4000 can you show the code used for the training phase?
@gost-sniper @lukemelas In b2, the freeze layer was implemented with blocks 20, 21, 22 and the FC layer. As a result, the percentage of correct answers increased to nearly 55% in the Placese365 standard data. Accuracy was improved by the decay of lr at the 30, 60, and 90 timings.
Why freeze FC layer would work? It seems that it doesn't make sense.
@crissallan I made a mistake in writing In b2, blocks 20, 21, 22, and all but the FC layer were implemented as a freeze layer.
@gost-sniper Less efficiently, we have created a fixed layer with
model = EfficientNet.from_pretrained(args.arch, advprop=args.advprop, num_classes=365)
for param in model.parameters():
param.requires_grad = False
for name, module in model.named_modules():
if name == '_blocks.20' or \
name == '_blocks.21' or \
name == '_blocks.22' or \
name == '_fc':
for param in module.parameters():
param.requires_grad = True
Hi @gost-sniper did you fixed the problem?
Could you please share with me your training code? (alancarlosml@outlook.com)
I am facing problems with a code I made here.
Thank you!
I'm trying to use pretrained model b-1 to train the model on Places365 but the training is blocking at ~25% (accuracy). I used Imagenet auto-augment policy founded here using this code: Dataloaders :
Training code :
test function:
I don't know what I'm doing wrong ? any help ?