yolact icon indicating copy to clipboard operation
yolact copied to clipboard

RuntimeError: legacy constructor expects device type: cpu but device type: cuda was passed

Open AnhDai1997 opened this issue 4 years ago • 2 comments

I try to inference with this code but errros,

from yolact import Yolact from utils.augmentations import FastBaseTransform import numpy as np import torch

print('Loading model...', end='') net = Yolact() net.load_weights('weights/yolact_resnet50_54_800000.pth') net.eval() net = net.cuda()

frame = torch.from_numpy(cv2.imread(img_path)).cuda().float() batch = FastBaseTransform()(frame.unsqueeze(0)) preds = net(batch) yolact_error

AnhDai1997 avatar Oct 13 '21 08:10 AnhDai1997

Hello, I have the same error message. Do you found a solution for this?

Peter

Petopp avatar Apr 25 '22 09:04 Petopp

Same issue here. What is strange is that even when I comment out the line 248, I'm getting the same error, at the same line (which is now a comment)

lchauvin avatar Jan 20 '23 06:01 lchauvin