OCR项目设置CUDA_VISIBLE_DEVICES后,找不到设备呢
Created by: astronstar
---------------------------------------------------------------------------KeyError Traceback (most recent call last)~/.paddlehub/modules/chinese_ocr_db_crnn_mobile/module.py in recognize_text(self, images, paths, use_gpu, output_dir, visualization, box_thresh, text_thresh) 177 try: --> 178 _places = os.environ["CUDA_VISIBLE_DEVICES"] 179 int(_places[0]) /opt/conda/envs/python35-paddle120-env/lib/python3.7/os.py in getitem(self, key) 677 # raise KeyError with the original key value --> 678 raise KeyError(key) from None 679 return self.decodevalue(value) KeyError: 'CUDA_VISIBLE_DEVICES' During handling of the above exception, another exception occurred: RuntimeError Traceback (most recent call last) in 11 visualization=False, # 是否将识别结果保存为图片文件; 12 box_thresh=0.1, # 检测文本框置信度的阈值; ---> 13 text_thresh=0.1) # 识别中文文本置信度的阈值; 14 15 for result in results: ~/.paddlehub/modules/chinese_ocr_db_crnn_mobile/module.py in recognize_text(self, images, paths, use_gpu, output_dir, visualization, box_thresh, text_thresh) 180 except: 181 raise RuntimeError( --> 182 "Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id." 183 ) 184 RuntimeError: Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id.