Multiple Issues with attack_adversarial_patch_pytorch_yolo.ipynb #2261
-
Describe the bug Issue 1 - While running Detector Predictions on Benign Images code getting bounding boxes on black images without rendering the actual image. Issue 2 - Error in Adversarial Patch Generation To Reproduce System information:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @alexdevassy Do you observe the same ValueError with torch 1.x? |
Beta Was this translation helpful? Give feedback.
-
Hi @alexdevassy thank you for pointing out these issues. I've investigated the and believe have found some answers. Issue 1 - ART will try to reuse as much memory as possible to avoid making copies. PyTorch operations like - dets = detector.predict(coco_images)
+ dets = detector.predict(coco_images.copy()) Issue 2 - Our current implementation of YOLO v3 uses the |
Beta Was this translation helpful? Give feedback.
Hi @alexdevassy thank you for pointing out these issues. I've investigated the and believe have found some answers.
Issue 1 - ART will try to reuse as much memory as possible to avoid making copies. PyTorch operations like
x_tensor = torch.from_numpy(x)
andx_tensor /= 255
will reuse the same memory as the numpy array. Therefore, when we resize the torch tensor from [0, 255] to [0, 1], it also resizes the original numpy array (since its the same internal memory). This is a bug that we'll fix. For now a temporary workaround create a copy before runningpredict
:Issue 2 - Our current implementation of YOLO …