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

源码安装部署, device type报错 #51

Open
cnspary opened this issue May 6, 2024 · 7 comments
Open

源码安装部署, device type报错 #51

cnspary opened this issue May 6, 2024 · 7 comments

Comments

@cnspary
Copy link

cnspary commented May 6, 2024

if torch.cuda.is_available(): device = "auto" else: device = "CPU"
当device被设置为auto时候会报以下错误:

RuntimeError: Expected one of cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, ort, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone device type at start of device string: auto

尝试将device 设置成为 cuda,会报 torch.cuda.OutOfMemoryError. 好像仅仅从单张4090显卡上申请内存,无法使用第二张4090显卡。

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 268.00 MiB (GPU 0; 23.65 GiB total capacity; 23.04 GiB already allocated; 169.81 MiB free; 23.04 GiB reserved in total by PyTorch)

@xky1998
Copy link

xky1998 commented Jun 3, 2024

一样的问题 楼主解决了吗

@cnspary
Copy link
Author

cnspary commented Jun 4, 2024

@xky1998 试试强制把 webdemo/webdemo.py 108行 inputs = tokenizer(prompt, return_tensors="pt").to(device) 修改成inputs = tokenizer(prompt, return_tensors="pt").to('cuda') 试一下。

@tupelo-shen
Copy link

1 终于跑起来了,不容易啊。

@zl-comment
Copy link

这个是直接部署的secGPT 运行webdemo吗?

@tupelo-shen
Copy link

这个是直接部署的secGPT 运行webdemo吗?

不是,直接部署的secGPT-mini

@leochans
Copy link

问题解决了吗?兄弟

@leochans
Copy link

07fff45b9b41f73acc3440c3ae3857b 他代码有问题。按照mini的webdemo改了之后就可以了

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

5 participants