# OOM Error when trying to save t5-large using save\_strategy="epoch"

**URL:** <https://discuss.huggingface.co/t/oom-error-when-trying-to-save-t5-large-using-save-strategy-epoch/8979>\
**Category:** Beginners\
**Created:** [August 5, 2021, 8:21am UTC](https://discuss.huggingface.co/t/oom-error-when-trying-to-save-t5-large-using-save-strategy-epoch/8979 "2021-08-05T08:21:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prikmm](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@prikmm](https://discuss.huggingface.co/u/prikmm)\
**Post date:** [August 5, 2021, 8:21am UTC](https://discuss.huggingface.co/t/oom-error-when-trying-to-save-t5-large-using-save-strategy-epoch/8979/1 "2021-08-05T08:21:07Z")

</div>

I am trying to finetune t5-large for summarization on xsum. I followed all the steps like:

- max\_input\_length=512,
- max\_target\_length=64,
- batch\_size=2,
- AdaFactor instead of AdamW,
- XLA\_USE\_BF16=true,
- initialized all models and datasets in the global scope instead of \_mp\_fn.

I want to know what I am doing wrong. I am using Kaggle and 16gb of RAM should be sufficient for this according to [T5 Finetuning tips](https://discuss.huggingface.co/t/t5-finetuning-tips/684).  
Please guide me

@valhalla @sgugger @sshleifer
