Morizeyao / GPT2-Chinese

Chinese version of GPT2 training code, using BERT tokenizer.
MIT License
7.46k stars 1.7k forks source link

直接运行train.py出现错误You requested GPUs: {gpus}\n But your machine only has: {all_available_gpus} #211

Closed 1727949032a closed 3 years ago

1727949032a commented 3 years ago

python版本: 3.6 错误信息: Traceback (most recent call last): File "D:/files/python/code/gpt2/GPT2-Chinese/train.py", line 216, in precision=32, File "D:\files\python\code\gpt2\GPT2-Chinese\venv\lib\site-packages\pytorch_lightning\trainer\connectors\env_vars_connector.py", line 40, in insert_env_defaults return fn(self, **kwargs) File "D:\files\python\code\gpt2\GPT2-Chinese\venv\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 321, in init replace_sampler_ddp, deterministic, precision, amp_backend, amp_level, plugins File "D:\files\python\code\gpt2\GPT2-Chinese\venv\lib\site-packages\pytorch_lightning\trainer\connectors\accelerator_connector.py", line 129, in init self.parallel_device_ids = device_parser.parse_gpu_ids(self.gpus) File "D:\files\python\code\gpt2\GPT2-Chinese\venv\lib\site-packages\pytorch_lightning\utilities\device_parser.py", line 81, in parse_gpu_ids gpus = _sanitize_gpu_ids(gpus) File "D:\files\python\code\gpt2\GPT2-Chinese\venv\lib\site-packages\pytorch_lightning\utilities\device_parser.py", line 150, in _sanitize_gpu_ids f"You requested GPUs: {gpus}\n But your machine only has: {all_available_gpus}" pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [0] But your machine only has: []

JHR0717 commented 3 years ago

可以看看你的torch是不是下载的gpu版本?