Trainer的使用问题


Trainer在实例化的时候不是已经传入加载的模型了吗，为什么 trainer.train(resume_from_checkpoint=checkpoint)还可以从保存的检查点加载模型？？？？
Hi @fxb392 

It's mostly for loading the  optimizer's scheduler and other states. But it's also convient if you load a canonical model (say from the Hub) while instantiating a trainer but want to use other checkpoints.

You don'<|||||>OK，thanks for you guidence.Does this  only means the trainer can conveniently load any checkpoints for train?<|||||>Yes, but you have to be careful to load the checkpoint which is saved by a trainer that loaded the same model type and the same model configuration.<|||||>Okay, I understand, thank you again.