Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Swin Transformer (ixRT)

Model Description

Swin Transformer is a pioneering neural network architecture that introduces a novel approach to handling local and global information in computer vision tasks. Departing from traditional self-attention mechanisms, Swin Transformer adopts a hierarchical design, organizing its attention windows in a shifted manner. This innovation enables more efficient modeling of contextual information across different scales, enhancing the model's capability to capture intricate patterns.

Supported Environments

GPU IXUCA SDK Release Branch
MR-V100 4.4.0 26.03 release/26.03
MR-V100 4.3.0 25.12 release/25.12

Note: 请切换到与您的 SDK 版本对应的 Release 分支进行测试。请勿直接在 master 分支上运行测试,因为 master 分支可能包含与您的本地 SDK 版本不兼容的最新更改。

切换分支命令示例:git checkout release/26.03

Model Preparation

Prepare Resources

Pretrained model: http://files.deepspark.org.cn:880/deepspark/data/checkpoints/swin_s_model_sim.onnx

Dataset: https://www.image-net.org/download.php to download the validation dataset.

Model Conversion

mkdir -p checkpoints
# download swin_s_model_sim.onnx into checkpoints

Model Inference

export PROJ_DIR=./
export DATASETS_DIR=./imagenet-val/
export CHECKPOINTS_DIR=./checkpoints
export RUN_DIR=../../ixrt_common/

FP16

# Accuracy
bash scripts/infer_swin_transformer_fp16_accuracy.sh
# Performance
bash scripts/infer_swin_transformer_fp16_performance.sh

Model Results

Model BatchSize Precision FPS Top-1(%) Top-5(%)
Swin Transformer 32 FP16 231.428 82.782 96.296