Skip to main content
Version: v2512

Accelerating ResNet50 Inference

This is a tutorial on accelerating the inference speed of image classification with ResNet50 using AcuiRT.

Introduction

  • Please refer to the Setup to install AcuiRT.

1. Prepare the dataset

  • Prepare a subset of ImageNet.

    git clone https://github.com/EliSchwartz/imagenet-sample-images

2. Execute the conversion

  • Run the example script from aibooster-examples. This sample converts ResNet50 to a TensorRT model with int8 quantization to accelerate inference.

    python intelligence/acuirt/image_classification_resnet50.py
  • The Top-1 accuracy and inference time are displayed for both the PyTorch model inference and the TensorRT model conversion.

    • Example output

      PyTorch: Top-1 Accuracy: 88.70%, Average Inference Time: 18214384 nanoseconds
      AcuiRT: Top-1 Accuracy: 88.50%, Average Inference Time: 1146944 nanoseconds