# Question about adafactor trainer

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fquestion-about-adafactor-trainer%2F19364%3E%5C
**Category:** Beginners\
**Created:** [June 20, 2022, 6:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fquestion-about-adafactor-trainer%2F19364 "2022-06-20T06:41:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LukeYang](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@LukeYang](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLukeYang)%5C
**Post date:** [June 20, 2022, 6:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fquestion-about-adafactor-trainer%2F19364%2F1 "2022-06-20T06:41:07Z")

</div>

I’m new to huggingface and currently I want to build a customized adafactor optimizer. The problem is that whenever I change the setting to relative\_step = True, the trainer throws error when trying to save trainer\_state.json. Here is the error screenshot

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/3/3ae29a11d9d5c80abd157e2c28c9f3fab3c60d11.png)  
When I set the lr to constant, there won’t be any error. I wonder how to solve this and is this a problem with adafactor?  
Here is my code  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/1/11e150a590c06753562ffac96e10cd9e93301929.png)

---

<div class="post-metadata">

**Author:** ![ndvb](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ndvb/32/17239_2.png) [@ndvb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fndvb)%5C
**Post date:** [February 14, 2023, 10:23am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fquestion-about-adafactor-trainer%2F19364%2F2 "2023-02-14T10:23:55Z")

</div>

I see that the optim in the TrainingArguments is marked out. Is it intentional, is it needed there or not?
