I got an error when using cw attack, I know the bug has been fixed but the problem still exists in the pip package (version 3.3.0), time to release a new version of torchattack 😀.
File "/home/hero/exp-code/0_attack.py", line 125, in test
adv_inputs = attack(inputs, targets)
File "/home/hero/.local/lib/python3.9/site-packages/torchattacks/attack.py", line 429, in __call__
adv_inputs = self.forward(inputs, labels, *args, **kwargs)
File "/home/hero/.local/lib/python3.9/site-packages/torchattacks/attacks/cw.py", line 84, in forward
f_loss = self.f(outputs, labels).sum()
File "/home/hero/.local/lib/python3.9/site-packages/torchattacks/attacks/cw.py", line 125, in f
one_hot_labels = torch.eye(len(outputs[0]))[labels].to(self.device)
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
❔ Any questions
I got an error when using cw attack, I know the bug has been fixed but the problem still exists in the pip package (version 3.3.0), time to release a new version of torchattack 😀.