diff --git a/train.py b/train.py index c814294..7bb13cc 100755 --- a/train.py +++ b/train.py @@ -123,8 +123,11 @@ def train(opt): """ start training """ start_iter = 0 if opt.saved_model != '': - start_iter = int(opt.saved_model.split('_')[-1].split('.')[0]) - print(f'continue to train, start_iter: {start_iter}') + try: + start_iter = int(opt.saved_model.split('_')[-1].split('.')[0]) + print(f'continue to train, start_iter: {start_iter}') + except: + pass start_time = time.time() best_accuracy = -1