audio_adversarial_examples icon indicating copy to clipboard operation
audio_adversarial_examples copied to clipboard

there is a error when run "attack.py"

Open wusq121 opened this issue 2 years ago • 9 comments

I ran the project on the branch edb1dce7 and successfully built the Docker container, as well as the first five steps of the README.md.

Step 4 only ran

docker run --gpus all -ti aae_deepspeech_093_gpu

But at Step 6, when I ran attack.py had some problems.

python3 attack.py \
        --input sample-000000.wav \
        --outprefix adv \
        --target "this is a test" \
        --iterations 1000 \
        --restore_path deepspeech-0.9.3-checkpoint/best_dev-1466475 \
        --scorer_path deepspeech-0.9.3-models.scorer \
        --alphabet_config_path DeepSpeech/data/alphabet.txt \

problem

root@bcd92f96180d:/# python3 attack.py \
>         --input sample-000000.wav \
>         --outprefix adv \
>         --target "this is a test" \
>         --iterations 1000 \
>         --restore_path deepspeech-0.9.3-checkpoint/best_dev-1466475 \
>         --scorer_path deepspeech-0.9.3-models.scorer \
>         --alphabet_config_path DeepSpeech/data/alphabet.txt \
> 
pydub was not loaded, MP3 compression will not work
source dB 89.62971687316895

Attack phrase:  this is a test

Initializing attack..

Initialization done.

Start attack..

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InternalError: 2 root error(s) found.
  (0) Internal: Blas xGEMM launch failed : a.shape=[1,40,257], b.shape=[1,257,159], m=40, n=159, k=257
         [[{{node MatMul}}]]
  (1) Internal: Blas xGEMM launch failed : a.shape=[1,40,257], b.shape=[1,257,159], m=40, n=159, k=257
         [[{{node MatMul}}]]
         [[raw_logits/_55]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "attack.py", line 408, in <module>
    run_script()
  File "attack.py", line 404, in run_script
    absl.app.run(main)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "attack.py", line 356, in main
    finetune)
  File "attack.py", line 195, in attack
    new, delta, probs_out, r_logits = sess.run((self.new_input, self.delta, self.probs, self.logits))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 956, in run
    run_metadata_ptr)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
    run_metadata)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InternalError: 2 root error(s) found.
  (0) Internal: Blas xGEMM launch failed : a.shape=[1,40,257], b.shape=[1,257,159], m=40, n=159, k=257
         [[node MatMul (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
  (1) Internal: Blas xGEMM launch failed : a.shape=[1,40,257], b.shape=[1,257,159], m=40, n=159, k=257
         [[node MatMul (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
         [[raw_logits/_55]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'MatMul':
  File "attack.py", line 408, in <module>
    run_script()
  File "attack.py", line 404, in run_script
    absl.app.run(main)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "attack.py", line 349, in main
    restore_path=FLAGS.restore_path)
  File "attack.py", line 109, in __init__
    self.logits = logits = get_logits(pass_in, lengths)
  File "/tf_logits.py", line 39, in get_logits
    upper_edge_hertz=FLAGS.audio_sample_rate / 2, dct_coefficient_count=Config.n_input)
  File "/mfcc.py", line 229, in compute_mfcc
    spectrogram, sample_rate, lower_edge_hertz, upper_edge_hertz, filterbank_channel_count)
  File "/mfcc.py", line 160, in compute_mfcc_mel_filterbank
    return tf.matmul(tf.cast(mapping_matrix_w, dtype), weighted) + tf.matmul(tf.cast(mapping_matrix_r, dtype), res)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/dispatch.py", line 180, in wrapper
    return target(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/math_ops.py", line 2716, in matmul
    return batch_mat_mul_fn(a, b, adj_x=adjoint_a, adj_y=adjoint_b, name=name)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/gen_math_ops.py", line 1712, in batch_mat_mul_v2
    "BatchMatMulV2", x=x, y=y, adj_x=adj_x, adj_y=adj_y, name=name)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()

wusq121 avatar Aug 23 '22 04:08 wusq121

@timherng Any idea what the issue could be?

tom-doerr avatar Aug 23 '22 14:08 tom-doerr

@timherng Any idea what the issue could be?

I figured my video memory wasn't enough to run this program, so I ran the Docker container on a 3080Ti 12GB. I don't know if there are any parameters in attack.py to adjust the space cost of the operation. I am new to TensorFlow.

wusq121 avatar Aug 24 '22 06:08 wusq121

i got this error too, but i run on 3090, how to solve it?

jacky-chan666 avatar Feb 09 '23 03:02 jacky-chan666

I solve this problem finally, the reason is the RTX 3090 can't work on cuda 11.0. I modify the code "FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 " to "FROM nvidia/cuda:11.6-devel-ubuntu18.04" in the Dockerfile , and it works well.

jacky-chan666 avatar Feb 09 '23 12:02 jacky-chan666

I solve this problem finally, the reason is the RTX 3090 can't work on cuda 11.0. I modify the code "FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 " to "FROM nvidia/cuda:11.6-devel-ubuntu18.04" in the Dockerfile , and it works well.

Excatly in the Dockerfile the new line is : FROM nvidia/cuda:11.6.0-devel-ubuntu18.04

Hactogeek avatar Mar 14 '23 12:03 Hactogeek

I solve this problem finally, the reason is the RTX 3090 can't work on cuda 11.0. I modify the code "FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 " to "FROM nvidia/cuda:11.6-devel-ubuntu18.04" in the Dockerfile , and it works well.

hi,I tried this and it run successfully,but the speed is quite slow. do you know why this happened?

skynp avatar Apr 20 '23 03:04 skynp

TensorFlow-gpu1.15.4  can't run on RTX 3090(30x),so you'd better check if the program runs only on cpu

---Original--- From: @.> Date: Thu, Apr 20, 2023 11:09 AM To: @.>; Cc: @.@.>; Subject: Re: [carlini/audio_adversarial_examples] there is a error when run"attack.py" (Issue #43)

I solve this problem finally, the reason is the RTX 3090 can't work on cuda 11.0. I modify the code "FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 " to "FROM nvidia/cuda:11.6-devel-ubuntu18.04" in the Dockerfile , and it works well.

hi,I tried this and it run successfully,but the speed is quite slow. do you know why this happened?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jacky-chan666 avatar Apr 20 '23 03:04 jacky-chan666

Thanks a ton!!!

------------------ 原始邮件 ------------------ 发件人: @.***>; 发送时间: 2023年4月20日(星期四) 中午11:47 收件人: "carlini/audio_adversarial_examples"; 抄送: "Comment"; 主题: Re: [carlini/audio_adversarial_examples] there is a error when run "attack.py" (Issue #43)

TensorFlow-gpu1.15.4&nbsp; can't run on RTX 3090(30x),so you'd better check if the program runs only on cpu

---Original--- From: @.&gt; Date: Thu, Apr 20, 2023 11:09 AM To: @.&gt;; Cc: @.@.&gt;; Subject: Re: [carlini/audio_adversarial_examples] there is a error when run"attack.py" (Issue #43)

I solve this problem finally, the reason is the RTX 3090 can't work on cuda 11.0. I modify the code "FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 " to "FROM nvidia/cuda:11.6-devel-ubuntu18.04" in the Dockerfile , and it works well.

hi,I tried this and it run successfully,but the speed is quite slow. do you know why this happened?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.&gt; — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

skynp avatar Apr 20 '23 03:04 skynp

I been trying to find the script that involves mkey salt and iterations for oracle padding

Gkc301 avatar Dec 12 '23 17:12 Gkc301