Giter Site home page Giter Site logo

microsoft / cvt Goto Github PK

View Code? Open in Web Editor NEW
538.0 12.0 119.0 167 KB

This is an official implementation of CvT: Introducing Convolutions to Vision Transformers.

License: MIT License

Python 97.83% Shell 2.17%
cvt deep-learning classification imagenet computer-vision

cvt's Issues

As for Cifar10 or Cifar100

请问有适合关于Cifar10 或者Cifar100的模型 SPEC吗?

Is there a model SPEC for Cifar10 or Cifar100?

Thank you very much!

22k model

Hi,thanks for your work, could you release the 22k model?

NAN loss

Hi, I just trained cvt13-224 model with the default settings, but got NAN loss after several epochs.
Does anyone have trained this model sucessfully?
图片

What's the accuracy of CvT-13 without pre-trained on CIFAR10

Hi,

What's the accuracy of CvT-13 without pre-trained on CIFAR10? Mine is only 79.6. Would you like to told me yours? And what are the hyper-parameters for fine-tuning on CIFAR10 without pre-trained ? I can't find it in detail in the paper.

Thanks.

Recommend change the code

recommend change the following code int lib/models/cls_cvt.py:611
x = torch.squeeze(x) change to x = torch.squeeze(x, dim=1)
Otherwise, an error will occur when bachsize = 1

Regarding the FLOPs

Hi,

I wonder how you computed the FLOPs. I used FlopCountAnalysis from fvcore.nn and it is larger than you reported.

精度

你好,请问我用imagenet1k进行训练时候,test精度好像完全没有变化,一直保持0.1左右,这是什么情况呢?

model release

Hi,would you like to provide a classification model on ImageNet22k?

recommended torch version may be wrong

After installing torch 1.7.1, I got an ERROR:
ModuleNotFoundError: No module named 'torch.fx
What I find on stackoverflow is that torch.fx was added in PyTorch 1.8.0., so may be recommended version is wrong?

How to calculate the flops of the model?

Hello, thanks for the great work, how to calculate the flops of the model. I have noticed that you report the flops of transformer based model, but I only found some tools of cnn models.

the flops computed by this code don't match that in the paper

2021-07-20 16:52:11,694:[P:33903]:Rank[0/4] == get_model_complexity_info by ptflops ==
2021-07-20 16:52:11,796:[P:33903]:Rank[0/4] => FLOPs: 4.06 GMac, params: 20.0 M
2021-07-20 16:52:11,796:[P:33903]:Rank[0/4] == get_model_complexity_info by ptflops ==

while the paper shows the flops of CvT-13 is 4.5G

Hyperparameters

Hi, thanks for this repo!
Could you please share the configuration for ImageNet experiments? I suppose the config file here is not the one used for ImageNet, or at least doesn't reflect what is written in the paper (please correct me if I'm wrong).
Many thanks!

code mismatch with the theory

Hi All,

Thanks for providing the code.
I come across the mismatch between the code and the theory you proposed for the transformer block. The paper says "Instead, we propose to replace the original position-wise linear projection for Multi-Head Self-Attention (MHSA)", but lines 198-200 in https://github.com/leoxiaobin/CvT/blob/main/lib/models/cls_cvt.py still projects q,k,v through linear layers. Have you missed an else statement there? why are you projecting q,k,v values twice?

Please correct me if I have misunderstood it.

Thanks,
Basavaraj

About Cls_cvt.py

I want to konw why there isn't any to the function get_cls_model and compute_macs

About the pretrained model

I use the pretrained model CvT-13-224x224-IN-1k.pth, and test on Imagenet as the guide, but the result is terrible
"TEST: Loss 8.5690 Error@1 98.926% Error@5 97.844% Accuracy@1 1.074% Accuracy@5 2.156%"

Does anyone else have tested? Why is it?

bugs when eval

2021-06-26 22:30:03,174:[P:3190309]:Rank[0/5] => switch to eval mode
2021-06-26 22:30:03,175:[P:3190312]:Rank[3/5] => Epoch[0]: train end, duration: 8942.97s
2021-06-26 22:30:03,176:[P:3190312]:Rank[3/5] => Epoch[0]: validate start
2021-06-26 22:30:03,176:[P:3190312]:Rank[3/5] => switch to eval mode
Traceback (most recent call last):
  File "tools/train.py", line 211, in <module>
    main()
  File "tools/train.py", line 153, in main
    args.distributed
  File "/python3.6/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/CvT/tools/../lib/core/function.py", line 133, in test
    loss = criterion(outputs, y)

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.