Saifeddine_Barkia:

itemindex = np.where(mask >= mask.max()*threshold)


Hi,
It seems mask is on GPU but you are trying to convert it to numpy before transferring it to cpu. Try to use torch.where instead of np.where in the line of error if you want to use GPU version or convert to numpy using mask.cpu().numpy()
Bests