Optimize a ResNet50* FP32 Inference Model Package with PyTorch*

Published: 12/09/2020

Download Command

wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/pytorch-resnet50-fp32-inference.tar.gz

Description

This document has instructions for running ResNet50* FP32 inference using Intel® Extension for PyTorch*.

Datasets

The ImageNet validation dataset is used when testing accuracy. The inference scripts use synthetic data, so no dataset is needed.

Download and extract the ImageNet2012 dataset from http://www.image-net.org/, then move validation images to labeled subfolders, using the valprep.sh shell script

The accuracy script looks for a folder named val, so after running the data prep script, your folder structure should look something like this:

imagenet
└── val
    ├── ILSVRC2012_img_val.tar
    ├── n01440764
    │   ├── ILSVRC2012_val_00000293.JPEG
    │   ├── ILSVRC2012_val_00002138.JPEG
    │   ├── ILSVRC2012_val_00003014.JPEG
    │   ├── ILSVRC2012_val_00006697.JPEG
    │   └── ...
    └── ...

The folder that contains the val directory should be set as the DATASET_DIR when running accuracy (for example: export DATASET_DIR=/home//imagenet).

Quick Start Scripts

Script name Description
fp32_online_inference Runs online inference using synthetic data (batch_size=1).
fp32_batch_inference Runs batch inference using synthetic data (batch_size=128).
fp32_accuracy Measures the model accuracy (batch_size=128).

Bare Metal

To run on bare metal, the following prerequisites must be installed in your environment:

Download and untar the model package and then run a quick start script.

# Optional: to run accuracy script
export DATASET_DIR=<path to the preprocessed imagenet dataset>

# Download and extract the model package
wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/pytorch-resnet50-fp32-inference.tar.gz
tar -xzf pytorch-resnet50-fp32-inference.tar.gz
cd pytorch-resnet50-fp32-inference

bash quickstart/<script name>.sh

 


Documentation and Sources

Get Started
Main GitHub*
Readme
Release Notes
Get Started Guide

Code Sources
Report Issue

 


License Agreement

LEGAL NOTICE: By accessing, downloading or using this software and any required dependent software (the “Software Package”), you agree to the terms and conditions of the software license agreements for the Software Package, which may also include notices, disclaimers, or license terms for third party software included with the Software Package. Please refer to the license file for additional details.


Related Containers and Solutions

ResNet50 FP32 Inference PyTorch* Container

View All Containers and Solutions 🡢

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.