Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chilo-ms authored Oct 14, 2024
1 parent 674a5df commit c8f7ce5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions quantization/image_classification/trt/resnet50/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ Following is the end-to-end example using ORT quantization tool to quantize ONNX

## Environment setup
### dataset
First, prepare dataset for calibration as well as evaluation.
We suggest to use ImageNet 2012 classification dataset to do the model calibration and evaluation. In addition to the sample code we provide below, TensorRT model optimizer which leverages torchvision.datasets already provides
the ability to work with ImageNet dataset.
First, prepare the dataset for calibration. TensorRT recommends calibration data size to be at least 500 for CNN and ViT models.
Generally, the dataset used for calibration should differ from the one used for evaluation. However, to simplify the sample code, we will use the same dataset for both calibration and evaluation. We recommend utilizing the ImageNet 2012 classification dataset for this purpose.

In addition to the sample code we provide below, TensorRT model optimizer which leverages torchvision.datasets already provides the ability to work with ImageNet dataset.

#### Prepare ImageNet dataset
You can either download from [Kaggle](https://www.kaggle.com/c/imagenet-object-localization-challenge/data) or origianl image-net website: val [tarball](https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar) and devkit [tarball](https://image-net.org/data/ILSVRC/2012/ILSVRC2012_devkit_t12.tar.gz)
Expand Down Expand Up @@ -79,6 +80,7 @@ wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/
| |-- ILSVRC2012_val_00003014.JPEG
...
```
Lastly, download `synset_words.txt` from https://github.com/HoldenCaulfieldRye/caffe/blob/master/data/ilsvrc12/synset_words.txt into `ILSVRC2012` (top-level folder)

## Quantize an ONNX model

0 comments on commit c8f7ce5

Please sign in to comment.