Where to set the Evaluation Batch Size in Trainer
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!!
2022-06-17T12:26:47Z
The default TrainingArguments have the following two options, for training and evaluation respectively. So you’ll need the latter.github.comhuggingface/transformers/blob/3c7e56fbb11f401de2528c1dcf0e282febc031cd/src/transformers/training_args.py#L141-L144per_device_train_batch_size (`int`, *optional*, defaults to 8):The batch size per GPU/TPU core/CPU for training.per_device_eval_batch_size (`int`, *optional*, defaults to 8):The batch size per GPU/TPU core/CPU for evaluation.
2022-06-17T12:56:07Z
Thank you so much! I was looking through the arguments in the docs but this I have missed! thanks a lot!