From 8a531f7040d88ad801e8e5d0a0697330d7f09c4b Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Mon, 2 Aug 2021 07:33:30 +0000 Subject: [PATCH] add strip for CUDA_VISIBLE_DEVICES --- deepspeech/utils/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepspeech/utils/log.py b/deepspeech/utils/log.py index 065a4c84d..3fd7d2480 100644 --- a/deepspeech/utils/log.py +++ b/deepspeech/utils/log.py @@ -157,7 +157,7 @@ class Autolog: model_precision="fp32"): import auto_log pid = os.getpid() - if (os.environ['CUDA_VISIBLE_DEVICES'] != ''): + if (os.environ['CUDA_VISIBLE_DEVICES'].strip() != ''): gpu_id = int(os.environ['CUDA_VISIBLE_DEVICES'].split(',')[0]) infer_config = inference.Config() infer_config.enable_use_gpu(100, gpu_id)