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

How to use gpu in the model ? #9

Closed lith0613 closed 5 years ago

lith0613 commented 5 years ago

I try to use the gpu in the one-pixel attack for imagenet, because the model run on imagenet is too slow, but I use os.environ["CUDA_VISIBLE_DEVICES"] seems did not work, can you give some help. Thanks so much !

Hyperparticle commented 5 years ago

Did you run the code in the notebook to check if the GPU is enabled? You can also try this StackOverflow post. If it's enabled for TensorFlow, it should be enabled for Keras.

Also, the repo now supports Google Colab, so you can also try out a free GPU cloud instance that way.

lith0613 commented 5 years ago

Thanks, I found I have just installed the cpu version tensorflow