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

Error running librispeech_asr_imperceptible_undefended.json #1472

Closed
lcadalzo opened this issue May 2, 2022 · 3 comments
Closed

Error running librispeech_asr_imperceptible_undefended.json #1472

lcadalzo opened this issue May 2, 2022 · 3 comments
Labels
ART blocked Depends on something else bug Something isn't working

Comments

@lcadalzo
Copy link
Contributor

lcadalzo commented May 2, 2022

File "/opt/conda/lib/python3.8/site-packages/art/attacks/evasion/imperceptible_asr/imperceptible_asr_pytorch.py", line 567, in _attack_2nd_stage[best_loss_2nd_stage[local_batch_size_idx] = loss_2nd_stage[local_batch_size_idx].numpy()
		RuntimeError^[[0m:^[[1m Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead
python -m armory run scenario_configs/librispeech_asr_imperceptible_undefended.json
@lcadalzo lcadalzo added the bug Something isn't working label May 2, 2022
@lcadalzo lcadalzo changed the title Error running Error running librispeech_asr_imperceptible_undefended.json May 2, 2022
@lcadalzo
Copy link
Contributor Author

lcadalzo commented May 2, 2022

Note: I'm unable to reproduce this error manually after observing it from the logs of the batch of runs

@davidslater davidslater added this to the Version 0.15.1 milestone May 2, 2022
@davidslater
Copy link
Contributor

I think this error only shows up when using GPUs. I was able to reproduce.

It looks like it's an ART error in
https://github.com/Trusted-AI/adversarial-robustness-toolbox/blob/main/art/attacks/evasion/imperceptible_asr/imperceptible_asr_pytorch.py#L567

best_loss_2nd_stage[local_batch_size_idx] = loss_2nd_stage[local_batch_size_idx].numpy()

should be

best_loss_2nd_stage[local_batch_size_idx] = loss_2nd_stage[local_batch_size_idx].detach().cpu().numpy()

Looks like there could be a similar issue here at https://github.com/Trusted-AI/adversarial-robustness-toolbox/blob/main/art/attacks/evasion/imperceptible_asr/imperceptible_asr_pytorch.py#L412 , where

                        max_local_delta = np.max(np.abs(local_delta[local_batch_size_idx].detach().numpy()))

should be

                        max_local_delta = np.max(np.abs(local_delta[local_batch_size_idx].detach().cpu().numpy()))

@davidslater
Copy link
Contributor

PR submitted to ART: Trusted-AI/adversarial-robustness-toolbox#1677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ART blocked Depends on something else bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants