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

目前的代码只能在GPU:0中运行吗? #159

Open
sukasu403 opened this issue Sep 10, 2024 · 0 comments
Open

目前的代码只能在GPU:0中运行吗? #159

sukasu403 opened this issue Sep 10, 2024 · 0 comments

Comments

@sukasu403
Copy link

pred_depth, confidence, output_dict = model.inference({'input': rgb})
我将模型和上述代码中的rgb通过to(device)移到GPU:1后会在代码的其他部分报错:
Metric3D/mono/model/decode_heads/RAFTDepthNormalDPTDecoder5.py", line 215, in compute_depth_expectation
depth = torch.sum(prob * depth_values, 1)
~~~~~^~~~~~~~~~~~~~
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0!
也就是说,目前代码中的数据都是全部默认放置在GPU:0中的?

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

1 participant