-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Example for Pytorch 3x Mixed Precision
Signed-off-by: zehao-intel <[email protected]>
- Loading branch information
1 parent
1f58f02
commit ae6651a
Showing
14 changed files
with
615 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Step-by-Step | ||
============ | ||
|
||
This document describes the step-by-step instructions for reproducing PyTorch ResNet18 MixedPrecision results with Intel® Neural Compressor. | ||
|
||
# Prerequisite | ||
|
||
### 1. Environment | ||
|
||
PyTorch 1.8 or higher version is needed with pytorch_fx backend. | ||
|
||
```Shell | ||
cd examples/3.x_api/pytorch/image_recognition/torchvision_models/mixed_precision/resnet18 | ||
pip install -r requirements.txt | ||
``` | ||
> Note: Validated PyTorch [Version](/docs/source/installation_guide.md#validated-software-environment). | ||
### 2. Prepare Dataset | ||
|
||
Download [ImageNet](http://www.image-net.org/) Raw image to dir: /path/to/imagenet. The dir includes below folder: | ||
|
||
```bash | ||
ls /path/to/imagenet | ||
train val | ||
``` | ||
|
||
# Run | ||
|
||
> Note: All torchvision model names can be passed as long as they are included in `torchvision.models`, below are some examples. | ||
## MixedPrecision | ||
```Shell | ||
bash run_autotune.sh --input_model=resnet18 --dataset_location=/path/to/imagenet | ||
``` | ||
|
||
## Benchmark | ||
```Shell | ||
# run optimized performance | ||
bash run_benchmark.sh --input_model=resnet18 --dataset_location=/path/to/imagenet --mode=performance --batch_size=100 --optimized=true --iters=500 | ||
# run optimized accuracy | ||
bash run_benchmark.sh --input_model=resnet18 --dataset_location=/path/to/imagenet --mode=accuracy --batch_size=1 --optimized=true | ||
``` | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.