Performing the attack on a GPU device? #1385
-
Hello As far as I looked into the code the generate methods for attacks only accept np.ndarray as inputs and there is no parameter when initializing an attack to set a GPU device. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi @kfarivar Thank you very much for using ART! Yes, of course you can use GPUs. Setting a specific device depends on the deep learning framework you are using. Which framework are you using? |
Beta Was this translation helpful? Give feedback.
-
hello, classifier = PyTorchClassifier(model=model, device_type="cuda",loss=nn.CrossEntropyLoss(), input_shape= ([10,3,112, 112]), nb_classes=8) noise_size = (112,112) image_adv = attack.generate(x=x_test_class_0, y=y_test_class_0, x_tar=x_tar_replicated) Where which generates following error:TypeError Traceback (most recent call last) 2 frames /usr/local/lib/python3.10/dist-packages/numpy/core/fromnumeric.py in min(a, axis, out, keepdims, initial, where) /usr/local/lib/python3.10/dist-packages/numpy/core/fromnumeric.py in _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs) TypeError: min() received an invalid combination of arguments - got (out=NoneType, axis=NoneType, ), but expected one of:
Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Hi @kfarivar Thank you very much for using ART! Yes, of course you can use GPUs. Setting a specific device depends on the deep learning framework you are using. Which framework are you using?