Baddet poisoning attack detector.fit() #2390
Replies: 1 comment 1 reply
-
Hi @antilaanssi What is the type of |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In this notebook: https://github.com/Trusted-AI/adversarial-robustness-toolbox/blob/main/notebooks/poisoning_attack_bad_det.ipynb
The notebook runs correctly until the very last line, ending in the following error:
TypeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 detector.fit(x_poisoned, y_poisoned, nb_epochs=1)
File E:\sepate_tests_for_thesis\env\lib\site-packages\art\estimators\object_detection\pytorch_object_detector.py:425, in PyTorchObjectDetector.fit(self, x, y, batch_size, nb_epochs, drop_last, scheduler, **kwargs)
422 raise ValueError("An optimizer is needed to train the model, but none for provided.")
424 # Apply preprocessing and convert to tensors
--> 425 x_preprocessed, y_preprocessed = self._preprocess_and_convert_inputs(x=x, y=y, fit=True, no_grad=True)
427 class ObjectDetectionDataset(Dataset):
428 """
429 Object detection dataset in PyTorch.
430 """
File E:\sepate_tests_for_thesis\env\lib\site-packages\art\estimators\object_detection\pytorch_object_detector.py:217, in PyTorchObjectDetector._preprocess_and_convert_inputs(self, x, y, fit, no_grad)
214 x_tensor, y_tensor = cast_inputs_to_pt(x, y)
216 if not self.channels_first:
--> 217 x_tensor = torch.permute(x_tensor, (0, 3, 1, 2))
218 x_tensor = x_tensor / norm_factor
220 # Set gradients
TypeError: permute(): argument 'input' (position 1) must be Tensor, not list
I tried changing the input type to tensors and a numpy array, but it still fails.
Any ideas why this might be or workarounds for the issue?
Beta Was this translation helpful? Give feedback.
All reactions