i like wasting time
This commit is contained in:
parent
fc09cff4b3
commit
798ed7730a
|
@ -215,7 +215,7 @@ class Trainer:
|
|||
|
||||
#### save models and training states
|
||||
if self.current_step % opt['logger']['save_checkpoint_freq'] == 0:
|
||||
self.model.consolidate_state(state)
|
||||
self.model.consolidate_state()
|
||||
if self.rank <= 0:
|
||||
self.logger.info('Saving models and training states.')
|
||||
self.model.save(self.current_step)
|
||||
|
|
|
@ -129,10 +129,10 @@ class BaseModel():
|
|||
network.load_state_dict(load_net_clean, strict=strict)
|
||||
|
||||
|
||||
def consolidate_state(self, state):
|
||||
def consolidate_state(self):
|
||||
for o in self.optimizers:
|
||||
if isinstance(o, ZeroRedundancyOptimizer):
|
||||
state['optimizers'].append(o.consolidate_state_dict(to=0))
|
||||
o.consolidate_state_dict(to=0)
|
||||
|
||||
|
||||
def save_training_state(self, state):
|
||||
|
|
Loading…
Reference in New Issue
Block a user