Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shape and Texture biased pretrain models #2

Closed
Chanfeechen opened this issue Oct 23, 2020 · 16 comments
Closed

Shape and Texture biased pretrain models #2

Chanfeechen opened this issue Oct 23, 2020 · 16 comments

Comments

@Chanfeechen
Copy link

Thank you for your exciting paper and nice script! I am interested in how the shape/texture biased model perform and would like to do some experiments on those biased models.
I wonder if you save shape/texture biased model (label-gamma=[1,0])? If possible, would you mind share a ResNet50 texture/shape biased pretrain model with me?
Thank you very much! : )

@LiYingwei
Copy link
Owner

Sure. I will check if I saved these models and get back to you. Please expect a little bit late response because I am catching a deadline next month.

@Chanfeechen
Copy link
Author

Chanfeechen commented Oct 23, 2020 via email

@Chanfeechen
Copy link
Author

Hi Yingwei~ In order to better schedule for my experiments, would you mind telling me what hardware you use to training the models?

@LiYingwei
Copy link
Owner

For the results on ImageNet, I use 8 Titan XP but it still takes a long period of time for training.

At the early stage of this project, I use ResNet-18 with a downsampled ImageNet to quickly see some signals.
The downsampled ImageNet in my initial experiments contains 200 classes (same as Tiny-ImageNet), 100,000 images (500 images per class) for training, and 10,000 images (50 images per class) for validation. These images are randomly selected from ImageNet.

@Chanfeechen
Copy link
Author

Thank you very much for the quick reply!!

@Chanfeechen
Copy link
Author

It's me again :) Thank you for your patient and quick response! I wonder if you still remember how many days does it takes your to train a model (for ResNet50 or other models)? (A approximation will be just fine! So that I can have an estimate on my experiments.)

@LiYingwei
Copy link
Owner

It's been a while since I ran the training script, so I am not that sure. The training time might also be different if the hardware (e.g., #CPU, #GPU) is different.

The training script prints a much accurate per-epoch time estimation, and then you could use that time to compute the total training time on your side. On my side, it takes about half a week for ResNet50, but, as again, it's been a while since I did experiments. If you want to speed up the training time, you can try to use DistributedDataParallel (instead of DataParallel) as the parallel strategy.

@Chanfeechen
Copy link
Author

Thank you very much for your advice and reply. It's very helpful and important to my future research!! : )

@Chanfeechen
Copy link
Author

Chanfeechen commented Nov 6, 2020

Hi LiYing, I had tried to train the texture/shape biased model with label-gamma = 0,1.
( With training command:
python imagenet.py -a resnet50 --data $DATA --epochs 100 --schedule 30 60 90 --checkpoint $MODEL_DIR --gpu-id 0 --train-batch 64 --lr 0.1 --mixbn --style --multi_grid --labeled-gamma 1)
But I only got around 33% validate accuracy for the extreme biased models(labeled gamma =1/0). It's not even close to the reported number in paper Table 1 (which is around 76%). I wonder if I were using the same setting as the reported model in Table 1. If possible, would you mind to check the hyper parameter settings for that extreme models for me?
Or Could you spot on any possible issues that might cause this huge difference?
Thank you very much!

@LiYingwei
Copy link
Owner

As I mentioned in #1 , when you use a small training batch size, the learning rate should be accordingly small. Could you try to set train-batch as 256 or set lr as 0.025? I don't know if there are other issues to fix since the performance is too low. What dataset do you use for training?

My script was:

python imagenet.py -a resnet50 --data $DATA --epochs 100 --schedule 30 60 90 --gamma 0.1 --checkpoint $MODEL_DIR --gpu-id 0,1,2,3,4,5,6,7 -j 8 --train-batch 256 --lr 0.1 --num_classes 1000 --mixbn --style --alpha 0.5 --lr_schedule step --multi_grid --label-mix-alpha 1 --warm_lr 0. --warm 5

@Chanfeechen
Copy link
Author

@LiYingwei I use ILSVRC2012-1k to train the model.
Thank you for your advise! I will try to set lr as 0.025.

@Chanfeechen
Copy link
Author

@LiYingwei I can not find the parameter --label-mix-alpha in script imagenet.py. Could you please double check your training command? Or maybe we are using different version?

@LiYingwei
Copy link
Owner

Should be --label-gamma. Sorry for the confusion.

@Chanfeechen
Copy link
Author

Gotha! Thank you! : )

@LiYingwei
Copy link
Owner

As promised, here are the Shape- and Texture-biased ResNet-50 models.

res50-shape-biased.pth.tar
res50-texture-biased.pth.tar

@Chanfeechen
Copy link
Author

Chanfeechen commented Nov 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants