Hyperparticle / one-pixel-attack-keras

Keras implementation of "One pixel attack for fooling deep neural networks" using differential evolution on Cifar10 and ImageNet
https://arxiv.org/abs/1710.08864
MIT License
1.21k stars 213 forks source link

AttributeError: 'DenseNet' object has no attribute '_model' #8

Closed fxle closed 5 years ago

fxle commented 5 years ago

pylint E0401:unable to import 'keras.utils' unable to import networks.capsulenet.capsule_net when i uesed ''python attack.py --model densenet capsnet'',the above problems appeared,Who can help me t how to solve it?tanks a lot

Hyperparticle commented 5 years ago

Did you make sure you have downloaded the densenet.h5 and capsnet.h5 models and put them in the models directory? Also, make sure you're running an up-to-date version of Keras.

fxle commented 5 years ago

But I can't find the densenet.h5 and capsnet.h5 models .Can you provide me with this download link?Thank you very much.

Hyperparticle commented 5 years ago

You can find the link in the Cifar10 Jupyter notebook, under the "Load Models" section. Alternatively, you can train the models yourself. https://www.dropbox.com/sh/dvatkpjl0sn79kn/AAC9L4puJ_sdFUkDZfr5SFkLa?dl=0

Hyperparticle commented 5 years ago

Have you solved your issue?

fxle commented 5 years ago

Yeah,Thank you for your concern. I have solved it and got the result.but how to show the results.pkl?

Hyperparticle commented 5 years ago

To show the results.pkl, you can use something like helper.load_results() and load the data into a Pandas DataFrame, as seen in the "Attack Statistics" section of the notebook.

fxle commented 5 years ago

Ok Thanks