nlsde-safety-team / DualAttentionAttack

53 stars 9 forks source link

TypeError: expected np.ndarray (got Tensor) #12

Open cserezwan opened 2 years ago

cserezwan commented 2 years ago

Hello, I'm facing the following error: TypeError: expected np.ndarray (got Tensor) image

Tried to change the line from torch.from_numpy to torch.as_tensor, but then it shows error in another line. Any idea of how to solve this issue?

iDTer commented 2 years ago

Try changing the code to look like this: texture_origin = torch.Tensor(textures[None, :, :, :, :, :].cpu()).cuda(device=0)