# Possible Issue with batch norm train/eval modes

**URL:** <https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632>\
**Category:** vision\
**Created:** [December 8, 2018, 2:58pm UTC](https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632 "2018-12-08T14:58:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [December 8, 2018, 8:00pm UTC](https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632/4 "2018-12-08T20:00:20Z")

</div>

From my understanding it sounds like datasetB is changing your running estimates in the `BatchNorm` layers such that datasetA performs bad.

Could you try to calculate the mean and std of both datasets using [this approach](https://discuss.pytorch.org/t/about-normalization-using-pre-trained-vgg16-networks/23560/6?u=ptrblck)? It would be interesting to see, if they are so different.

---

_[View the full topic](https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632)._
