I got EfficientNet working well for PETS dataset, where only 1 label per image is enough. Unfortunately, when I tried EfficientNet with with multiple labels per image, I encountered a problem. After creating datablock with MultiCategoryBlock, I try to run fine_tune():
It turns out the fix is simple, I need to explicitly specify number of categories (num_classes) when creating EfficientNet model. Planet dataset has 17 tags, so num_classes=17.
model = EfficientNet.from_pretrained(model_name, advprop=True, num_classes=17)
Ahhh yes. I was wondering about that. Another technique is to use create_body and create_head so it’s more fastai-like (fastai has it’s own head it uses). See my efficientnet notebook here: