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: 'ResNet' object has no attribute '_model' #13

Closed upcdz closed 5 years ago

upcdz commented 5 years ago

When I run python train.py --model resnet --epochs 200 --batch_size 128 It occurs an error:

Traceback (most recent call last): File "train.py", line 40, in model.train() File "/home/cvers/zgz/one-pixel-attack-keras-master/networks/resnet.py", line 162, in train self.param_count = self._model.count_params() AttributeError: 'ResNet' object has no attribute '_model' Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x7f9c07081be0>> Traceback (most recent call last): File "/home/cvers/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 701, in del TypeError: 'NoneType' object is not callable

Hyperparticle commented 5 years ago

I found the error, I accidentally reference self._model before I assign it.

Hyperparticle commented 5 years ago

Fix should be pushed, give it a try.