Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gen_attack's error on GPU. #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZhangYuef
Copy link

To fix the error of running gen_attack with a GPU. Before fix the error report is as:

File "/advertorch-master/advertorch/attacks/blackbox/gen_attack.py", line 357, in perturb
elite_adv, _, _ = gen_attack(
File "/advertorch-master/advertorch/attacks/blackbox/gen_attack.py", line 221, in gen_attack
pop_t = eps[:, None, None] * pop_t
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant