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

AssertionError: Torch not compiled with CUDA enabled #221

Closed
ymzx opened this issue Aug 26, 2022 · 4 comments
Closed

AssertionError: Torch not compiled with CUDA enabled #221

ymzx opened this issue Aug 26, 2022 · 4 comments

Comments

@ymzx
Copy link

ymzx commented Aug 26, 2022

为什么在CPU本地跑ppq,会报CUDA相关编译错误?如何解决?
image

@ZhangZhiPku
Copy link
Collaborator

ZhangZhiPku commented Aug 26, 2022

你的pytorch好像完全没装cuda,并且你在lsq optimization方法里选了collecting device = cuda...请把它改成cpu
if TRAINING_YOUR_NETWORK:
QS.lsq_optimization = True # 启动网络再训练过程,降低量化误差
QS.lsq_optimization_setting.epochs = 30 # 再训练轮数,影响训练时间,30轮大概几分钟
QS.lsq_optimization_setting.collecting_device = 'cuda' # 缓存数据放在那,cuda 就是放在gpu,如果显存超了你就换成 'cpu'
此处请把lsq_optimization_setting.collecting_device换成cpu

@ZhangZhiPku
Copy link
Collaborator

当然,我们更加建议你换个有gpu的电脑来跑量化:https://www.autodl.com/home

@ymzx
Copy link
Author

ymzx commented Aug 26, 2022

已经指定了 executing_device = ‘cpu’,为什么后面程序还是出现cuda呢?

@ZhangZhiPku
Copy link
Collaborator

lsq那个collecting_device是独立的,默认是cuda

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