Skip to content
Advertisement

Cannot run Carlini and Wagner Attack using foolbox on a tensorflow Model

I am using the latest version of foolbox (3.3.1), and my code simply load a RESNET-50 CNN, adds some layers for a transferred learning application, and loads the weights as follows.

JavaScript

Now I would like to attack it using the foolbox 3.3.1 Carlini and Wagner attack, here is the way I load the model for foolbox

JavaScript

My dataset is split into 10 images per document, I will attack these 10 images using a batch size of 10 for foolbox using Carlini and Wagner attack

JavaScript

However, whenever I run the code, here is the error that is returned to me

JavaScript

What is supposed to be the error? am I loading my model wrongly? should I add new parameters for the attack called? as previously stated, I am on foolbox 3.3.1.

Advertisement

Answer

I think you might have mixed up the parameters of the L2CarliniWagnerAttack. Here is a simplified working example with dummy data:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement