Closed cod3r0k closed 5 years ago
Hi @cod3r0k, the attacks in foolbox
expect you to pass them exactly one example, i.e. the x
array should have rank 3 and the shape (W, H, C)
. Judging from the way how you call attack(...)
right now, it does look like you are including a batch dimension of size 1
. Just make sure that your data has an appropriate shape - then your problem should go away.
Seems to be solved.
Hi! Today I faced a problem with foolbox. My data is vectors with related tags. But each attack faced the same problem as below:
fmodel = foolbox.models.KerasModel(model, bounds=(-1, 1)) attack = foolbox.attacks.FGSM(fmodel) attack
in this line I faced the problem:adversarial = attack(x_test[0:1], y_test[0:1])
the error is : `AssertionError Traceback (most recent call last)