Update UModel.py

This commit is contained in:
Uyghur 2021-10-21 10:40:01 +09:00 committed by GitHub
parent 8842af01f7
commit 1211aaae26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,6 +95,8 @@ class UModel(nn.Module):
def _load(self, load_best=False): def _load(self, load_best=False):
path = None path = None
self.trained_epochs = 0
self.best_cer = 1.0
if load_best == True and os.path.exists(self.checkpoint + '_best.pth'): if load_best == True and os.path.exists(self.checkpoint + '_best.pth'):
path = path = self.checkpoint + '_best.pth' path = path = self.checkpoint + '_best.pth'
elif os.path.exists(self.checkpoint + '_last.pth'): elif os.path.exists(self.checkpoint + '_last.pth'):