# Where to set the Evaluation Batch Size in Trainer

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhere-to-set-the-evaluation-batch-size-in-trainer%2F19284%3E%5C
**Category:** Beginners\
**Created:** [June 17, 2022, 10:04am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhere-to-set-the-evaluation-batch-size-in-trainer%2F19284 "2022-06-17T10:04:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ollibolli](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ollibolli/32/16121_2.png) [@ollibolli](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Follibolli)%5C
**Post date:** [June 17, 2022, 10:04am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhere-to-set-the-evaluation-batch-size-in-trainer%2F19284%2F1 "2022-06-17T10:04:37Z")

</div>

Hi, I am training a model on colab with the trainer class. Training is fine. However I am running into the problem that I get a CUDA out of memory error and I am seeing the trainer uses evaluation of batch size = 8 even though I have a batch size of 2.

I did not see a parameter that I can set to change it.  
Is my only option to subclass the Trainer class?

Thanks for any tips and help!!

---

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FBramVanroy)%5C
**Post date:** [June 17, 2022, 12:26pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhere-to-set-the-evaluation-batch-size-in-trainer%2F19284%2F2 "2022-06-17T12:26:47Z")

</div>

The default TrainingArguments have the following two options, for training and evaluation respectively. So you’ll need the latter.

> <https://github.com/huggingface/transformers/blob/3c7e56fbb11f401de2528c1dcf0e282febc031cd/src/transformers/training_args.py#L141-L144>

---

<div class="post-metadata">

**Author:** ![ollibolli](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ollibolli/32/16121_2.png) [@ollibolli](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Follibolli)%5C
**Post date:** [June 17, 2022, 12:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhere-to-set-the-evaluation-batch-size-in-trainer%2F19284%2F3 "2022-06-17T12:56:07Z")

</div>

Thank you so much! I was looking through the arguments in the docs but this I have missed! thanks a lot!
