Skip to content

Commit

Permalink
Update train_net.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZhang534 authored Oct 24, 2023
1 parent f95cd41 commit e6998ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion train_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ def main(args=None):
trainer.resume_or_load(resume=args.resume)
if args.original_load: # loading checkpoints with different name prefix
print("using original loading")
trainer._trainer.model.module = trainer._trainer.model.module.from_pretrained(cfg.MODEL.WEIGHTS)
try:
trainer._trainer.model.module = trainer._trainer.model.module.from_pretrained(cfg.MODEL.WEIGHTS)
except Exception as e: # for debugging
trainer._trainer.model = trainer._trainer.model.from_pretrained(cfg.MODEL.WEIGHTS)
return trainer.train()


Expand Down

0 comments on commit e6998ed

Please sign in to comment.