XiaYuanOwO/ascend-resnet34-a1-in1k-model
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

ResNet-34 Image Classification Model for Ascend NPU

#+NPU

NPU Python PyTorch

Model Overview

Model Name: resnet34.a1_in1k

Architecture: ResNet-34 (Residual Network with 34 layers)

Parameters: ~21.8M

Pretrained Dataset: ImageNet-1k (1.2M images, 1000 classes)

Task: Image Classification

Description: ResNet-34 with AutoAugment (a1) preprocessing, pretrained on ImageNet-1k. This model uses residual connections to enable training of deeper networks and applies AutoAugment learned augmentation policies during training for improved accuracy.

Hardware

Target Platform: Ascend NPU (Huawei Atlas)

Runtime: torch_npu (Ascend PyTorch Plugin)

Performance

Inference Performance (Single Image)

DeviceLatencyThroughputSpeedup vs CPU
NPU2.45 ms408 FPS1.23x
CPU3.01 ms332 FPS1.00x

Top-5 Predictions Comparison

RankNPU ClassNPU ProbCPU ClassCPU ProbMatch
12590.84722590.8471Yes
22810.05232810.0524Yes
32820.04122820.0411Yes
42880.01582880.0159Yes
52850.01242850.0123Yes

Top-5 Prediction Match: 100%

Model Adaptation Summary

AttributeValue
StatusSUCCESS
Pretrained UsedYes
Local Weight UsedYes
Match Within 1%Yes

Usage

Installation

pip install -r requirements.txt

Run Inference

python inference.py

Output Files

  • logs/run_npu.log - NPU inference performance log
  • logs/accuracy_compare.log - CPU vs NPU prediction comparison
  • logs/summary.json - Summary of adaptation results

Requirements

  • Python 3.8+
  • PyTorch 2.0+
  • timm (PyTorch Image Models)
  • torchvision
  • torch_npu (Ascend PyTorch Plugin)
  • CANN (Compute Architecture for Neural Networks)

License

This model follows the license of its source (timm/ImageNet).

Acknowledgments

  • Model from timm library
  • Pretrained weights from ImageNet-1k
  • Ascend NPU support via torch_npu