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

int4量化版本运行报错 #45

Closed
icuai opened this issue Apr 22, 2023 · 5 comments
Closed

int4量化版本运行报错 #45

icuai opened this issue Apr 22, 2023 · 5 comments

Comments

@icuai
Copy link

icuai commented Apr 22, 2023

环境:
RTX 4090
WSL2, Ubuntu 22
torch version: 2.0.0+cu117

RuntimeError: Expected all tensors to be on the same device, but found at least two 
devices, cuda:0 and cpu! (when checking argument for argument index in method 
wrapper_CUDA__index_select)

image

@Tongjilibo
Copy link

Tongjilibo commented Apr 22, 2023

你这个错误比较好解决吧,因为你的model放在gpu上,但是inputs还在cpu上,试试下面这么修改是否可以
inputs = tokenizer(plain_text, return_tensors='pt').cuda()

@txsun1997
Copy link
Contributor

@icuai readme有点bug,稍后更新

@Hzfinfdu
Copy link
Member

已修复

@icuai
Copy link
Author

icuai commented Apr 23, 2023

感谢,已经可以正常运行了

1 similar comment
@icuai
Copy link
Author

icuai commented Apr 23, 2023

感谢,已经可以正常运行了

@icuai icuai closed this as completed Apr 23, 2023
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

4 participants