# How to add preprocess into the model

**URL:** <https://discuss.pytorch.org/t/how-to-add-preprocess-into-the-model/66154>\
**Category:** Uncategorized\
**Created:** [January 9, 2020, 5:40am UTC](https://discuss.pytorch.org/t/how-to-add-preprocess-into-the-model/66154 "2020-01-09T05:40:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MarcSteven](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@MarcSteven](https://discuss.pytorch.org/u/MarcSteven)\
**Post date:** [January 9, 2020, 7:21am UTC](https://discuss.pytorch.org/t/how-to-add-preprocess-into-the-model/66154/3 "2020-01-09T07:21:59Z")

</div>

Thank you , but the machine learning engineer told me it’s impossible to add the preprocess into the model. I reviewed the code and then find it doesn’t have the code (No normalize), does it influence the effect?  
We compose a sequence of transformation to pre-process the image:

```auto
import torchvision.transforms as transforms

transform = transforms.Compose(
    [transforms.ToTensor(),
     transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])

```

---

_[View the full topic](https://discuss.pytorch.org/t/how-to-add-preprocess-into-the-model/66154)._
