Hyperparticle / one-pixel-attack-keras

Keras implementation of "One pixel attack for fooling deep neural networks" using differential evolution on Cifar10 and ImageNet

Home Page:https://arxiv.org/abs/1710.08864

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'ResNet' object has no attribute '_model'

upcdz opened this issue · comments

commented

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

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

Fix should be pushed, give it a try.