diff --git a/spacy/cli/evaluate.py b/spacy/cli/evaluate.py index f409821b1..d9be95fae 100644 --- a/spacy/cli/evaluate.py +++ b/spacy/cli/evaluate.py @@ -39,7 +39,7 @@ def evaluate(cmd, model, data_path, gpu_id=-1, gold_preproc=False): Train a model. Expects data in spaCy's JSON format. """ util.use_gpu(gpu_id) - util.set_env_log(True) + util.set_env_log(False) data_path = util.ensure_path(data_path) if not data_path.exists(): prints(data_path, title="Evaluation data not found", exits=1) diff --git a/spacy/util.py b/spacy/util.py index 911970831..e1a721a12 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -563,7 +563,10 @@ def minify_html(html): def use_gpu(gpu_id): - import cupy.cuda.device + try: + import cupy.cuda.device + except ImportError: + return None from thinc.neural.ops import CupyOps device = cupy.cuda.device.Device(gpu_id) device.use()