File tree 1 file changed +5
-2
lines changed
pytorch_lightning/trainer
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ class TrainerEvaluationLoopMixin(ABC):
180
180
tpu_id : int
181
181
verbose_test : bool
182
182
running_sanity_check : bool
183
+ testing : bool
183
184
amp_backend : AMPType
184
185
185
186
# Callback system
@@ -371,9 +372,11 @@ def _evaluate(
371
372
372
373
# track outputs for collation
373
374
if output is not None :
375
+ do_write_preds = self .testing and isinstance (output , EvalResult ) and not self .running_sanity_check
374
376
# Add predictions to our prediction collection if they are found in outputs
375
- if isinstance (output , EvalResult ):
376
- predictions .add (output .pop ('_predictions' , None ))
377
+ if do_write_preds :
378
+ predictions .add (output .pop ('predictions' , None ))
379
+
377
380
dl_outputs .append (output )
378
381
379
382
self .__eval_add_step_metrics (output )
You can’t perform that action at this time.
0 commit comments