Closed MoiseRousseau closed 1 year ago
Or, at least, changing by:
one_hot_labels = (torch.eye(len(outputs[0]).to(self.device))[labels]
Or, at least, changing by:
one_hot_labels = (torch.eye(len(outputs[0]).to(self.device))[labels]
Hi @MoiseRousseau , this bug has actually been fixed, but since the new version has not been released, the problem still exists for those installing via pip.
Hi @rikonaka ,
I indeed installed torckattacks with PyPi, thanks for keeping me informed!
Moise
✨ Short description of the bug [tl;dr]
I am running several attacks on different neural net. I first load the dataset on the GPU and then perform the generation on the GPU too. While this works well for many attacks (FGSM, BIM, PGD, VANILA, ...), this fails only for the CW attack. I work with torchattacks-3.3.0.
💬 Detailed code and results
The CW attack fails with the following error:
Changing the faulty line (125 in attacks/cw.py) by:
solve the problem.
I can send a minimal reproducible example if you need it.
Moise