Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU报错 #9

Open
Harry-hash opened this issue Jul 4, 2021 · 2 comments
Open

CPU报错 #9

Harry-hash opened this issue Jul 4, 2021 · 2 comments

Comments

@Harry-hash
Copy link

Harry-hash commented Jul 4, 2021

为什么在CPU上跑tasks/squad/train.py的时候会有这个报错
“”“
Traceback (most recent call last):
File "/Users/hodge/Documents/GitHub/diceLoss/tasks/squad/train.py", line 369, in
main()
File "/Users/hodge/Documents/GitHub/diceLoss/tasks/squad/train.py", line 363, in main
trainer.fit(model)
File "/Users/hodge/opt/anaconda3/envs/diceloss/lib/python3.6/site-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
result = fn(self, *args, **kwargs)
File "/Users/hodge/opt/anaconda3/envs/diceloss/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1083, in fit
self.accelerator_backend.setup(model)
File "/Users/hodge/opt/anaconda3/envs/diceloss/lib/python3.6/site-packages/pytorch_lightning/accelerators/cpu_backend.py", line 26, in setup
raise MisconfigurationException('amp + cpu is not supported. Please use a GPU option')
pytorch_lightning.utilities.exceptions.MisconfigurationException: amp + cpu is not supported. Please use a GPU option
”“”
但是我已经把第一个参数--gpus="1"改成--gpus="0"了

@Harry-hash
Copy link
Author

我的环境是这样的:
Package Version


absl-py 0.13.0
cachetools 4.2.2
certifi 2021.5.30
chardet 4.0.0
click 8.0.1
dataclasses 0.8
filelock 3.0.12
future 0.18.2
google-auth 1.32.1
google-auth-oauthlib 0.4.4
grpcio 1.38.1
idna 2.10
importlib-metadata 4.6.0
joblib 1.0.1
Markdown 3.3.4
mkl-fft 1.3.0
mkl-random 1.0.4
mkl-service 2.3.0
numpy 1.17.0
oauthlib 3.1.1
olefile 0.46
packaging 21.0
Pillow 8.2.0
pip 21.1.3
protobuf 3.17.3
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyparsing 2.4.7
pytorch-lightning 0.9.0
PyYAML 5.4.1
regex 2021.7.1
requests 2.25.1
requests-oauthlib 1.3.0
rsa 4.7.2
sacremoses 0.0.45
sentencepiece 0.1.91
setuptools 52.0.0.post20210125
six 1.16.0
tensorboard 2.2.0
tensorboard-plugin-wit 1.8.0
tokenizers 0.9.3
torch 1.7.1
torchaudio 0.7.0a0+a853dff
torchvision 0.8.2
tqdm 4.61.1
transformers 3.5.1
typing-extensions 3.10.0.0
urllib3 1.26.6
Werkzeug 2.0.1
wheel 0.36.2
zipp 3.5.0

@xiaoya-li
Copy link
Contributor

xiaoya-li commented Aug 3, 2021

您好,非常抱歉,我们的repo是基于GPU机器进行开发的,并没有遇到您说的情况。
根据您提供的在CPU上运行的报错信息,感觉是这个--amp-backend这个参数设置的问题,麻烦请您参考pytorch-lightning==0.9.0的文档,https://pytorch-lightning.readthedocs.io/en/0.9.0/trainer.html#amp-backend
感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants