LeeSureman / Flat-Lattice-Transformer

code for ACL 2020 paper: FLAT: Chinese NER Using Flat-Lattice Transformer
1k stars 178 forks source link

use python flat_main.py --device "cpu" 出现 ValueError: There is no usable gpu. set `device` as `cpu` or `None`. #69

Open s1162276945 opened 3 years ago

s1162276945 commented 3 years ago

Traceback (most recent call last): File "flat_main.py", line 582, in check_code_level=-1) File "D:\Anaconda3\lib\site-packages\fastNLP\core\trainer.py", line 499, in init self.model = _move_model_to_device(model, device=device) File "D:\Anaconda3\lib\site-packages\fastNLP\core\utils.py", line 228, in _move_model_to_device raise ValueError("There is no usable gpu. set device as cpu or None.") ValueError: There is no usable gpu. set device as cpu or None.

LeeSureman commented 3 years ago

可能你的运行环境没有显卡?

s1162276945 commented 3 years ago

可能你的运行环境没有显卡?

是的,所以我用cpu跑着测试一下

zelin-x commented 3 years ago

也可能是pytorch与cuda版本不对应,也会报这个错误

houyuchao commented 5 months ago

可能你的运行环境没有显卡?

是的,所以我用cpu跑着测试一下

用cpu跑只需要将device设置成cpu就可以把,但是我爆出了这个错误 image