v
v50_/timm-xcit_large_24_p8_224.fb_dist_in1k-NPU
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

xcit_large_24_p8_224.fb_dist_in1k — 昇腾NPU适配

适用于华为昇腾NPU(Ascend910B)的图像分类模型

1. 模型概述

项目详情
模型xcit_large_24_p8_224.fb_dist_in1k
框架timm(PyTorch)
任务图像分类(ImageNet-1K,1000类)
参数188.9M
来源ModelScope

2. 环境

  • 硬件:昇腾910B4-1
  • 操作系统:Linux(aarch64)
  • Python:3.10
  • PyTorch:2.10.0+torch_npu
  • timm:1.0.27
  • CANN:8.x

3. 文件

├── model_utils.py          # Model loading & preprocessing utilities
├── inference.py            # Single-image inference script
├── eval_accuracy.py        # CPU-NPU accuracy consistency check
├── benchmark.py            # Performance benchmark script
├── assets/
│   └── test.jpg            # Test image
├── logs/
│   ├── inference.log       # Inference output
│   ├── accuracy.log        # Accuracy comparison
│   └── benchmark.log       # Performance data
└── README.md

4. 快速开始

# Install dependencies
pip install torch torch-npu timm modelscope

# Run inference
python inference.py

5. 推理结果

NPU 上的单张测试图像:

排名类别概率

6. 精度对比:CPU 与 NPU

指标数值
max_abs_error0.040529
mean_abs_error0.008674
relative_error1.7881%
cosine_similarity0.999890
Top-1 matchTrue

注意:这是基于单张测试图像的快速一致性检查,而非官方的 ImageNet 完整验证集评估。

7. 性能

指标数值
Throughputimages_per_sec 21.79 images/sec
DeviceNPU:0 (Ascend 910B)
PrecisionFP32

8. 复现步骤

# 1. Download model weights
python -c "from modelscope import snapshot_download; snapshot_download('timm/xcit_large_24_p8_224.fb_dist_in1k', cache_dir='/data/modelscope_cache')"

# 2. Run inference
python inference.py

# 3. Check accuracy
python eval_accuracy.py

# 4. Run benchmark
python benchmark.py

9. 竞赛提交信息

项目详情
原始权重地址xcit_large_24_p8_224.fb_dist_in1k
提交项目地址timm-xcit_large_24_p8_224.fb_dist_in1k-NPU
适配框架torch_npu
适配硬件Ascend 910B

10. 注意事项

  • 模型权重不包含在本仓库中
  • 权重通过 snapshot_download 从 ModelScope 下载
  • 所有推理和精度检查均使用 FP32 精度

11. 标签

NPU Ascend Ascend910 torch_npu timm ImageClassification #xcit_large_24_p8_224.fb_dist_in1k