"vscode:/vscode.git/clone" did not exist on "a895029424afc3666415efeeeda308e1304aab19"
Commit bb261c5c authored by hx89's avatar hx89 Committed by Francisco Massa
Browse files

Add commands to run quantized model with pretrained weights (#1547)

parent 9cdc8144
......@@ -67,3 +67,24 @@ For Mobilenet-v2, the model was trained with quantization aware training, the se
Training converges at about 10 epochs.
For post training quant, device is set to CPU. For training, the device is set to CUDA
### Command to evaluate quantized models using the pre-trained weights:
For all quantized models except inception_v3:
```
python references/classification/train_quantization.py --data-path='imagenet_full_size/' \
--device='cpu' --test-only --backend='fbgemm' --model='<model_name>'
```
For inception_v3, since it expects tensors with a size of N x 3 x 299 x 299, before running above command,
need to change the input size of dataset_test in train.py to:
```
dataset_test = torchvision.datasets.ImageFolder(
valdir,
transforms.Compose([
transforms.Resize(342),
transforms.CenterCrop(299),
transforms.ToTensor(),
normalize,
]))
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment