I found an error for running BPA when python main.py --attack=bpa --model resnet50:
Traceback (most recent call last): File "/home/baseline.py", line 181, in <module> main() File "/home/baseline.py", line 105, in main perturbations = attacker(images, labels) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/attack.py", line 169, in __call__ return self.forward(*input, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 57, in forward logits = bpa_forw_resnet(self.model, data+delta, self.bpa_layer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 148, in bpa_forw_resnet x = layer_forw(jj, kk, 1, ind, x, mm) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 144, in layer_forw x = block_func(mm, x, do_bpa=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 177, in block_func out += identity RuntimeError: The size of tensor a (64) must match the size of tensor b (256) at non-singleton dimension 1
Thanks for your sharing! an amazing work!
I found an error for running BPA when
python main.py --attack=bpa --model resnet50:
Traceback (most recent call last): File "/home/baseline.py", line 181, in <module> main() File "/home/baseline.py", line 105, in main perturbations = attacker(images, labels) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/attack.py", line 169, in __call__ return self.forward(*input, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 57, in forward logits = bpa_forw_resnet(self.model, data+delta, self.bpa_layer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 148, in bpa_forw_resnet x = layer_forw(jj, kk, 1, ind, x, mm) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 144, in layer_forw x = block_func(mm, x, do_bpa=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/transferattack/model_related/bpa.py", line 177, in block_func out += identity RuntimeError: The size of tensor a (64) must match the size of tensor b (256) at non-singleton dimension 1