Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
jasonhuang 7c9b14aa93 | 1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
README_CN.md | 1 year ago | |
vit.png | 1 year ago | |
vit_b32_224_ascend.yaml | 1 year ago | |
vit_b32_224_ascend_pynative.yaml | 1 year ago | |
vit_l16_224_ascend.yaml | 1 year ago | |
vit_l32_224_ascend.yaml | 1 year ago |
[2010.11929] An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (arxiv.org)
While the Transformer architecture has become the de-facto standard for natural language processing tasks, its applications to computer vision remain limited. In vision, attention is either applied in conjunction with convolutional networks, or used to replace certain components of convolutional networks while keeping their overall structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.), Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.
Model | Context | Top-1 (%) | Top-5 (%) | Params(M) | Train T. | Infer T. | Download | Config | Log |
---|---|---|---|---|---|---|---|---|---|
vit_b_32_224 | D910x8-G | 75.86 | 92.08 | 86 | 619ms/step | 11.6ms/step | model | cfg | log |
vit_l_16_224 | D910x8-G | 76.34 | 92.79 | 307 | 632ms/step | 5.37ms/step | model | cfg | log |
vit_l_32_224 | D910x8-G | 73.71 | 90.92 | 307 | 534ms/step | 6.22ms/step | model | cfg | log |
Please refer to the installation instruction in MindCV.
Please download the ImageNet-1K dataset for model training and validation.
Hyper-parameters. The hyper-parameter configurations for producing the reported results are stored in the yaml files in mindcv/configs/vit
folder. For example, to train with one of these configurations, you can run:
# train vit on 8 NPUs
mpirun -n 8 python train.py -c configs/vit/vit_b32_224_ascend.yaml --data_dir /path/to/imagenet
Note that the number of GPUs/Ascends and batch size will influence the training results. To reproduce the training result at most, it is recommended to use the same number of GPUs/Ascneds with the same batch size.
Detailed adjustable parameters and their default value can be seen in config.py
To validate the trained model, you can use validate.py
. Here is an example for vit_b_32 to verify the accuracy of pretrained weights.
python validate.py -c configs/vit/vit_b32_224_ascend.yaml --data_dir /path/to/imagenet --ckpt_path /path/to/ckpt
Please refer to the deployment tutorial in MindCV.
No Description
Jupyter Notebook Python Markdown Text
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》