Skip to content

Commit 081679b

Browse files
authored
Update README.md
1 parent ab81c74 commit 081679b

File tree

1 file changed

+47
-1
lines changed
  • quantization/image_classification/trt/resnet50

1 file changed

+47
-1
lines changed
Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
11
# ONNX PTQ for using TensorRT EP
22
Following is the end-to-end example using ORT quantization tool to quantize ONNX model and run/evaluate the quantized model with TRT EP.
33

4-
## Note
4+
## Environment setup
5+
### dataset
56
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
67
the ability to work with ImageNet dataset.
8+
9+
#### Prepare ImageNet dataset
10+
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)
11+
```shell
12+
mkdir ILSVRC2012
13+
cd ILSVRC2012
14+
wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar --no-check-certificate
15+
wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_devkit_t12.tar.gz --no-check-certificate
16+
```
17+
Untar the tarballs to `val` and `ILSVRC2012_devkit_t12` folder separately.
18+
19+
The dataset layout should look like this:
20+
21+
```
22+
|-- ILSVRC2012_devkit_t12
23+
| |-- COPYING
24+
| |-- data
25+
| | |-- ILSVRC2012_validation_ground_truth.txt
26+
| | `-- meta.mat
27+
| |-- evaluation
28+
| | |-- VOCreadrecxml.m
29+
| | |-- VOCreadxml.m
30+
| | |-- VOCxml2struct.m
31+
| | |-- compute_overlap.m
32+
| | |-- demo.val.pred.det.txt
33+
| | |-- demo.val.pred.txt
34+
| | |-- demo_eval.m
35+
| | |-- eval_flat.m
36+
| | |-- eval_localization_flat.m
37+
| | |-- get_class2node.m
38+
| | `-- make_hash.m
39+
| `-- readme.txt
40+
|-- meta.bin
41+
`-- val
42+
|-- n01440764
43+
| |-- ILSVRC2012_val_00000293.JPEG
44+
| |-- ILSVRC2012_val_00002138.JPEG
45+
| |-- ILSVRC2012_val_00003014.JPEG
46+
...
47+
```
48+
Note: If the data in `val` folder is not grouped by class, please run following command to reconstruct the layout
49+
```shell
50+
cd val/
51+
wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash
52+
```

0 commit comments

Comments
 (0)