yasenh / libtorch-yolov5

A LibTorch inference implementation of the yolov5
MIT License
372 stars 114 forks source link

The model I want to export runs on multiple GPUs #55

Closed zhongqingyang closed 1 month ago

zhongqingyang commented 2 years ago

I use

# line 28
img = torch.zeros((opt.batch_size, 3, *opt.img_size)).to(device='cuda')  
# line 31
model = attempt_load(opt.weights, map_location=torch.device('cuda'))

But it can only be loaded on GPU0。

# line 28
img = torch.zeros((opt.batch_size, 3, *opt.img_size)).to(device='cuda:1')  
# line 31
model = attempt_load(opt.weights, map_location=torch.device('cuda:1'))

But it can only be loaded on GPU1.

Can you give an opinion.

zhongqingyang commented 2 years ago

No, I'm thinking about giving up yolov5

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月8日(星期三) 晚上9:17 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [yasenh/libtorch-yolov5] The model I want to export runs on multiple GPUs (#55)

我使用

line 28 img = torch.zeros((opt.batch_size, 3, *opt.img_size)).to(device='cuda') # line 31 model = attempt_load(opt.weights, map_location=torch.device('cuda'))

但它只能加载到GPU0上。

line 28 img = torch.zeros((opt.batch_size, 3, *opt.img_size)).to(device='cuda:1') # line 31 model = attempt_load(opt.weights, map_location=torch.device('cuda:1'))

但它只能加载到GPU1上。

你能给出一个意见吗?

你修复了吗??

— 您收到此邮件是因为您创作了该线程。 直接回复此电子邮件,在 GitHub 上查看,或取消订阅。 使用适用于iOS或Android的 GitHub Mobile 随时随地对通知进行分类。