# Correct way to calculate FLOPS in model

**URL:** <https://discuss.pytorch.org/t/correct-way-to-calculate-flops-in-model/67198>\
**Category:** Uncategorized\
**Created:** [January 20, 2020, 6:18pm UTC](https://discuss.pytorch.org/t/correct-way-to-calculate-flops-in-model/67198 "2020-01-20T18:18:03Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![ppwwyyxx](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ppwwyyxx/32/3031_2.png) [@ppwwyyxx](https://discuss.pytorch.org/u/ppwwyyxx)\
**Post date:** [May 8, 2022, 8:55pm UTC](https://discuss.pytorch.org/t/correct-way-to-calculate-flops-in-model/67198/14 "2022-05-08T20:55:59Z")

</div>

The error said it very well:

> ValueError: In training mode, targets should be passed

Set `model.eval()` in order to make predictions with the model.

---

_[View the full topic](https://discuss.pytorch.org/t/correct-way-to-calculate-flops-in-model/67198)._
