Adding more information on Trainer state

Hi
I would like to same more information on trainer state to load them later, I am doing it like

self.state.A = A

then, I need to load them later as:

path = # saved_path of state 
state = TrainerState.load_from_json(path)
print(state.A) 

then this gives the error that A does not exist, could you please help me?

thanks @sgugger

The state is not expandable. You should save your information separately to reload it like that.

1 Like

Thanks for your help