# Performance drops dramatically when switch to model.eval

**URL:** <https://discuss.pytorch.org/t/performance-drops-dramatically-when-switch-to-model-eval/130199>\
**Category:** vision\
**Created:** [August 25, 2021, 3:11am UTC](https://discuss.pytorch.org/t/performance-drops-dramatically-when-switch-to-model-eval/130199 "2021-08-25T03:11:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dongdongtong](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dongdongtong/32/41258_2.png) [@dongdongtong](https://discuss.pytorch.org/u/dongdongtong)\
**Post date:** [August 25, 2021, 9:34am UTC](https://discuss.pytorch.org/t/performance-drops-dramatically-when-switch-to-model-eval/130199/2 "2021-08-25T09:34:48Z")

</div>

Frankly, I am doing an unsupervised domain adaptation project, so I figure out what is influencing the performance when using BatchNorm layers just now.

Here is the solution link which is helpful folayersr those UDA project with BatchNorm.  
[Possible Issue with batch norm train/eval modes](https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632)

For a short word, this answer helps me a lot.  
[https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632/2?u=dongdongtong](https://discuss.pytorch.org/t/possible-issue-with-batch-norm-train-eval-modes/31632/2)

But it is very strange to do this because when we deploy a model pretrained on the training set, we don’t hope to change the parameters of the pretrained model, so I am exploring other solutions.

---

_[View the full topic](https://discuss.pytorch.org/t/performance-drops-dramatically-when-switch-to-model-eval/130199)._
