LTS4 / DeepFool

A simple and accurate method to fool deep neural networks
355 stars 131 forks source link

Issue with variable sizing #1

Closed neale closed 7 years ago

neale commented 7 years ago

I found an issue when running the python test_deepfool code. Could be my machine, but I this is what I ran into with a fresh pytorch 0.1.12 The test file doesn't work right away for me, I had to change a couple indexing lines that were giving me trouble.

#Line 81 in deepfool.py should be 
fs = net.forward(x)
#line 53 in test_deepfool.py then is this
plt.imshow(np.clip(tf(pert_image.cpu()[0]), 0, 255))

For me this fixed a 5D variable that was being passed into resnet as input, instead of a 4D like it wants.

husseinfawzi commented 7 years ago

Thanks for raising the problem. We corrected this issue in the new version.