From c045a9c7f637f85f7beccdae48a4cb765516d558 Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Fri, 1 May 2020 12:05:33 +0200 Subject: [PATCH] Fix logic in train CLI timing eval on GPU (#5387) Run CPU timing in first iteration only --- spacy/cli/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/cli/train.py b/spacy/cli/train.py index db58b22df..6e6423131 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -456,7 +456,7 @@ def train( gpu_wps = nwords / (end_time - start_time) # Only evaluate on CPU in the first iteration (for # timing) if GPU is enabled - if i >= 1: + if i == 0: with Model.use_device("cpu"): nlp_loaded = util.load_model_from_path(epoch_model_path) for name, component in nlp_loaded.pipeline: