Coder Social home page Coder Social logo

Comments (16)

LiYingwei avatar LiYingwei commented on May 28, 2024 1

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.

from shapetexturedebiasedtraining.

LiYingwei avatar LiYingwei commented on May 28, 2024 1

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.

from shapetexturedebiasedtraining.

LiYingwei avatar LiYingwei commented on May 28, 2024 1

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

from shapetexturedebiasedtraining.

LiYingwei avatar LiYingwei commented on May 28, 2024 1

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

from shapetexturedebiasedtraining.

LiYingwei avatar LiYingwei commented on May 28, 2024

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.

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

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

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

Thank you very much for the quick reply!!

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

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.)

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

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

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

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!

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

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

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

@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?

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

Gotha! Thank you! : )

from shapetexturedebiasedtraining.

LiYingwei avatar LiYingwei commented on May 28, 2024

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

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

from shapetexturedebiasedtraining.

Chanfeechen avatar Chanfeechen commented on May 28, 2024

from shapetexturedebiasedtraining.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.