Fix bug in examples: double wrap into DataParallel during eval
This commit is contained in:
committed by
Julien Chaumond
parent
7f23af1684
commit
b1ff0b2ae7
@@ -278,7 +278,7 @@ def evaluate(args, model, tokenizer, criterion, prefix=""):
|
||||
)
|
||||
|
||||
# multi-gpu eval
|
||||
if args.n_gpu > 1:
|
||||
if args.n_gpu > 1 and not isinstance(model, torch.nn.DataParallel):
|
||||
model = torch.nn.DataParallel(model)
|
||||
|
||||
# Eval!
|
||||
|
||||
Reference in New Issue
Block a user