File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -97,16 +97,17 @@ def main():
9797
9898 # optionally resume from a checkpoint
9999 elif args .resume :
100- assert os .path .isfile (args .resume ), \
101- "=> no checkpoint found at '{}'" .format (args .resume )
102- print ("=> loading checkpoint '{}'" .format (args .resume ))
103- checkpoint = torch .load (args .resume )
100+ chkpt_path = args .resume
101+ assert os .path .isfile (chkpt_path ), \
102+ "=> no checkpoint found at '{}'" .format (chkpt_path )
103+ print ("=> loading checkpoint '{}'" .format (chkpt_path ))
104+ checkpoint = torch .load (chkpt_path )
104105 args = checkpoint ['args' ]
105106 start_epoch = checkpoint ['epoch' ] + 1
106107 best_result = checkpoint ['best_result' ]
107108 model = checkpoint ['model' ]
108109 optimizer = checkpoint ['optimizer' ]
109- output_directory = os .path .dirname (os .path .abspath (args . resume ))
110+ output_directory = os .path .dirname (os .path .abspath (chkpt_path ))
110111 print ("=> loaded checkpoint (epoch {})" .format (checkpoint ['epoch' ]))
111112 train_loader , val_loader = create_data_loaders (args )
112113 args .resume = True
You can’t perform that action at this time.
0 commit comments