# Trainer() and required\_grad=false

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-and-required-grad-false%2F41230%3E%5C
**Category:** 🤗Transformers\
**Created:** [May 28, 2023, 4:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-and-required-grad-false%2F41230 "2023-05-28T16:34:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dampish](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Dampish](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FDampish)%5C
**Post date:** [May 28, 2023, 4:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-and-required-grad-false%2F41230%2F1 "2023-05-28T16:34:56Z")

</div>

hey guys i just have a quick question, if i freeze 12 out of 16 layers, does huggingface trainer() load everything into memory anyway?

---

<div class="post-metadata">

**Author:** ![sbchoi](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@sbchoi](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsbchoi)%5C
**Post date:** [January 18, 2024, 8:06am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-and-required-grad-false%2F41230%2F2 "2024-01-18T08:06:25Z")

</div>

also curious @Dampish Did you solved the problem?
