<p>Those are mean and standard deviation used to standardize each channel of the images from <a href="https://www.image-net.org/" rel="nofollow noreferrer">IMAGENET</a> used to train the <a href="https://pytorch.org/vision/stable/models.html" rel="nofollow noreferrer">torchvision pretrained models</a>.</p>
<p>Since the models were trained using this preprocessing step, it is useful to apply it also when using those models for transfer learning on new data.</p>

CC BY-SA 4.0
2022-07-19T07:12:51.270Z
2022-07-19T07:12:51.270Z
Edoardo Guerriero
<p>in <a href="https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html" rel="nofollow noreferrer">this pytorch tutorial</a>, there is <code>transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])</code>, what is the purpose of this?</p>
<p>(i removed it and the code still works)</p>

<convolutional-neural-networks><pytorch>
what is `Normalize` for in PyTorch transfer learning tutorial?
em1971
# what is `Normalize` for in PyTorch transfer learning tutorial?

(Asked by: username_0 on 2022-07-19)

in [this pytorch tutorial](https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html), there is `transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])`, what is the purpose of this?

(i removed it and the code still works)

**Tags:** convolutional-neural-networks, pytorch


---

## 1 answers

### Answer by username_1 on 2022-07-19. Score: 1 | Accepted answer

Those are mean and standard deviation used to standardize each channel of the images from [IMAGENET](https://www.image-net.org/) used to train the [torchvision pretrained models](https://pytorch.org/vision/stable/models.html).

Since the models were trained using this preprocessing step, it is useful to apply it also when using those models for transfer learning on new data.


---

