Closed clannadcl closed 3 years ago
What is your PyTorch version?
@feiyuhuahuo i have same error,pytorch 1.6
change version to pytorch 1.9, i's ok
Don't need to change the version of pytorch. Just change
box_thre = torch.clip(box_thre, min=0., max=1.) # Yolact_minimal/utils/output_utils.py line 150+
to
box_thre = torch.clamp(box_thre, min=0., max=1.) # pytorch 1.5.0
or to
tmp = np.clip(box_thre.cpu().numpy(),a_min=0., a_max=1.) # numpy 1.21.1
box_thre =torch.from_numpy(tmp).cuda()
# box_thre = torch.clip(box_thre, min=0., max=1.)
Traceback (most recent call last):
File "detect.py", line 73, in
ids_p, class_p, box_p, coef_p, proto_p = nms(class_p, box_p, coef_p, proto_p, net.anchors, cfg)
File "/root/paddlejob/workspace/env_run/video_tag/code/yolact/utils/output_utils.py", line 153, in nms
box_thre = torch.clip(box_thre, min=0., max=1.)
AttributeError: module 'torch' has no attribute 'clip'