mmasana / FACIL

Framework for Analysis of Class-Incremental Learning with 12 state-of-the-art methods and 3 baselines.
https://arxiv.org/pdf/2010.15277.pdf
MIT License
509 stars 97 forks source link

Issue with ImageNet-Subset #45

Open kandeldeepak46 opened 2 months ago

kandeldeepak46 commented 2 months ago

I ran the finetuning script for imagenet-subset python src/main_incremental.py --approach finetuning --nepochs 200 --batch-size 128 --num-workers 4 --datasets imagenet_subset --num-tasks 12 --nc-first-task 25 --lr 0.05 --weight-decay 1e-3 --clipping 1 --network resnet32 --momentum 0.9 --exp-name exp1 --seed 0

But I am getting this syntactical error image

Has somebody got such an issue?

mmasana commented 2 months ago

If you are running experiments on ImageNet, you probably want to replace --network resnet32 by a network which expects and input of 224x224, such as ResNet-18. Alternatively, you could resize the images to the input size of ResNet-32, which is 32x32. But I guess the other option is closer that what you want.

kandeldeepak46 commented 2 months ago

Thank you so much.

I used resnet-18 instead and it works

Have you simulated in tiny-imagenet-200?

the get_data() method in line 72 in _dataloader.py does not work because the data directory in tiny-imagenet-200 is different than other ImageNet version.

mmasana commented 2 months ago

For the tiny-imagenet-200, you can use the instructions here to be able to generate the dataset splits. You basically generate the train.txt and test.txt with the paths however you have them.

For example, in the train.txt you could have something like this:

tiny_imagenet_200/train/n02124075/images/n02124075_3.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_133.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_461.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_450.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_303.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_374.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_79.JPEG 0
tiny_imagenet_200/train/n02124075/images/n02124075_100.JPEG 0
...