carlini/audio_adversarial_examples

Errors about running making_checkpoint.py and attack.py

040840308 opened this issue · 6 comments

Hi,
I have installed DeepSpeech v0.1.1 through git clone https://github.com/mozilla/DeepSpeech.git; And also I have downloaded the DeepSpeech model wget https://github.com/mozilla/DeepSpeech/releases/download/**v0.1.0**/deepspeech-0.1.0- models.tar.gz tar -xzf deepspeech-0.1.0-models.tar.gz.

 I also installed TensorFlow (1.8.0) , CUDA 9.0, cuDNN 7.0.5.


 I still have the following errors:

(AdversarialAudio) root@zy-Lenovo:/home/zy/Adversarial_AudioXiaolei# python attack.py --in sample.wav --target "example" --out adversarial.wav
source dB 90.3087329864502
ERROR: The decoder library file does not exist. Make sure you have downloaded or built the native client binaries and pass the appropriate path to the binaries in the --decoder_library_path parameter.
Traceback (most recent call last):
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call
return fn(*args)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on models/session_dump: Not found: models; No such file or directory
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "attack.py", line 387, in
main()
File "attack.py", line 365, in main
l2penalty=args.l2penalty)
File "attack.py", line 127, in init
saver.restore(sess, "models/session_dump")
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1802, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
run_metadata)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on models/session_dump: Not found: models; No such file or directory
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op 'save/RestoreV2', defined at:
File "attack.py", line 387, in
main()
File "attack.py", line 365, in main
l2penalty=args.l2penalty)
File "attack.py", line 126, in init
saver = tf.train.Saver([x for x in tf.global_variables() if 'qq' not in x.name])
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1338, in init
self.build()
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1347, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1384, in _build
build_save=build_save, build_restore=build_restore)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 835, in _build_internal
restore_sequentially, reshape)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 472, in _AddRestoreOps
restore_sequentially)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 886, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1463, in restore_v2
shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/root/virtualenvs/AdversarialAudio/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to get matching files on models/session_dump: Not found: models; No such file or directory
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

    Did someone encounter similar problems?
    Thanks for any advice.

It looks like the file didn't download. Can you show me the result of

4. Verify that you have a file models/output_graph.pb, it's MD5 sum should be
08a9e6e8dc450007a0df0a37956bc795.

(AdversarialAudio) root@zy-Lenovo:/home/zy/Adversarial_AudioXiaolei/DeepSpeech# md5sum models/output_graph.pb
08a9e6e8dc450007a0df0a37956bc795 models/output_graph.pb

The models folder shouldn't be in the DeepSpeech sub-folder.

That is, the directory should be

audio_adversarial_examples
audio_adversarial_examples/models
audio_adversarial_examples/DeepSpeech

Thanks, it seems work although has an error.
(AdversarialAudio) root@zy-Lenovo:/home/zy/Adversarial_AudioXiaolei# python attack.py --in sample.wav --target "example" --out adversarial.wav
source dB 90.3087329864502
ERROR: The decoder library file does not exist. Make sure you have downloaded or built the native client binaries and pass the appropriate path to the binaries in the --decoder_library_path parameter.
a
-------------a-----------------------------------
35.565 35.565
34.278 34.278
30.621 30.621
26.325 26.325

That's an error from deepspech. It will work with it. I'll push something to silence the error.

@040840308 Hi, did you get the error "ERROR: The decoder library file does not exist. Make sure you have downloaded or built the native client binaries and pass the appropriate path to the binaries in the --decoder_library_path parameter" when you run "python3 make_checkpoint.py"?
And how do you fix your error?