RuntimeError: legacy constructor expects device type: cpu but device type: cuda was passed
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)

Hello, I have the same error message. Do you found a solution for this?
Peter
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)