Can I use Feature Adversaries - PyTorch with GPU? #2003
-
Hi, I defined a pytorch classfier: criterion = torch.nn.CrossEntropyLoss() and a Feature Adversaries attack in the following way: attack = FeatureAdversariesPyTorch( I pass it a source and a guide: x_test_adv = attack.generate(data, guide) But when I try to run it, I'm getting the following error: `13, in FeatureAdversariesPyTorch.generate(self, x, y, **kwargs) TypeError: Cannot interpret 'torch.float32' as a data type` It seems that it's looking for numpy data type, but I pass it tensors since I work on GPU. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @matanle51 Yes, you should be able to use Feature Adversaries with GPUs. What is the type of your variable |
Beta Was this translation helpful? Give feedback.
Hi @matanle51 Yes, you should be able to use Feature Adversaries with GPUs. What is the type of your variable
data
andguide
?