mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
avoid getting undefined
This commit is contained in:
parent
89ba0da910
commit
7a6369156f
@ -136,8 +136,8 @@ def resume_checkpoint(
|
|||||||
if 'version' in checkpoint and checkpoint['version'] > 1:
|
if 'version' in checkpoint and checkpoint['version'] > 1:
|
||||||
resume_epoch += 1 # start at the next epoch, old checkpoints incremented before save
|
resume_epoch += 1 # start at the next epoch, old checkpoints incremented before save
|
||||||
|
|
||||||
if log_info:
|
if log_info:
|
||||||
_logger.info("Loaded checkpoint '{}' (epoch {})".format(checkpoint_path, checkpoint['epoch']))
|
_logger.info("Loaded checkpoint '{}' (epoch {})".format(checkpoint_path, checkpoint['epoch']))
|
||||||
else:
|
else:
|
||||||
model.load_state_dict(checkpoint)
|
model.load_state_dict(checkpoint)
|
||||||
if log_info:
|
if log_info:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user