Sha-Lab / FEAT

The code repository for "Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions"
MIT License
418 stars 84 forks source link

About the 5-shot results on miniimagenet #50

Closed zhanyuanyang closed 3 years ago

zhanyuanyang commented 3 years ago

Hi, thanks for your nice work!

I use training scripts given in README.md with pretrained ResNet12 model:

python train_fsl.py --max_epoch 200 --model_class FEAT --backbone_class Res12 --dataset MiniImageNet --way 5 --eval_way 5 --shot 5 --eval_shot 5 --query 15 --eval_query 15 --balance 0.1 --temperature 64 --temperature2 32 --lr 0.0002 --lr_mul 10 --lr_scheduler step --step_size 40 --gamma 0.5 --gpu 1 --init_weights ./saves/initialization/miniimagenet/Res12-pre.pth --eval_interval 1 --use_euclidean

But I got "Test acc=0.7821 + 0.0015" which is far lower from the results "82.05%" reported on paper.

image

Did I miss something?

Han-Jia commented 3 years ago

Please try with the dataset from this link where the model is pre-trained from.

zhanyuanyang commented 3 years ago

Thanks for the reply, I try the dataset downloaded from the above link, and I got:

image

Is there any difference between these two miniimagenet datasets? ( I used the same split method)

Han-Jia commented 3 years ago

I use the dataset provided from the paper "optimization as a model for few-shot learning". There may exist some dataset variants with different pre-processing or sizes.

I think the main reason for the difference is the matching between the dataset and the pre-trained weights. You can try pre-training a model over your dataset and then fine-tune with the meta-learning methods. It may get better results.

zhanyuanyang commented 3 years ago

I have understood and thank you very much for your reply.