mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-12-05 05:38:31 +08:00
skip training while n_epoch in trainer is not greater than 0
This commit is contained in:
parent
d4b4ffa28b
commit
e0d6a259ae
@ -181,6 +181,10 @@ class Trainer(object):
|
||||
|
||||
"""
|
||||
results = {}
|
||||
if self.n_epochs <= 0:
|
||||
print(f"training epoch is {self.n_epochs}, nothing was done.")
|
||||
results['seconds'] = 0.
|
||||
return results
|
||||
try:
|
||||
if torch.cuda.is_available() and self.use_cuda:
|
||||
self.model = self.model.cuda()
|
||||
|
Loading…
Reference in New Issue
Block a user