# How to freeze layers using trainer?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-freeze-layers-using-trainer%2F4702%3E%5C
**Category:** Beginners\
**Created:** [March 19, 2021, 11:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-freeze-layers-using-trainer%2F4702 "2021-03-19T11:44:58Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [March 19, 2021, 4:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-freeze-layers-using-trainer%2F4702%2F7 "2021-03-19T16:37:39Z")

</div>

You should inspect the weights to see where they difer then. `Trainer` will not change the `requires_grad` value of your parameters.

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-freeze-layers-using-trainer%2F4702)._
