hiromu / robust_audio_ae

Robust Audio Adversarial Example for a Physical Attack
BSD 2-Clause "Simplified" License
61 stars 22 forks source link

AttributeError: module 'DeepSpeech' has no attribute 'TrainingCoordinator' #8

Open shizhuoyang opened 3 years ago

shizhuoyang commented 3 years ago

With the command "md5sum models/output_graph.pb", the output is the same as yours, but when running attack.py, the output is Traceback (most recent call last): File "attack.py", line 51, in DeepSpeech.TrainingCoordinator.init = lambda x: None AttributeError: module 'DeepSpeech' has no attribute 'TrainingCoordinator'

I wonder if you have met this problem, looking forward to your reply, thank you.

hiromu commented 3 years ago

You seem to be using the different version of the source code of DeepSpeech. Please confirm that you have specified v0.1.0 via git checkout command.

shizhuoyang commented 2 years ago

I have checked that my DeepSpeech version is v0.1.0, and this problem I have solved, now I meet a new problem when running make_checkpoint.py: Traceback (most recent call last) : File "make checkpoint.py", line 28, in «module> import DeepSpeech File "DeepSpeech/DeepSpeech.py", line 29, in module> from xdg import BaseDirectory as xdg ImportError: cannot import name 'BaseDirectory' I have tried many versions of xdg, but nothing has changed

hiromu commented 2 years ago

I never saw the error, but maybe this is related: https://askubuntu.com/questions/871838/xdg-basedirectory-import-error

shizhuoyang commented 2 years ago

Thanks for your replying! After trying this method, I successfully solve the problem. But when running python attack.py --in 121.wav --imp rir/*.wav --target "hello world" --out results, I met the other problem:

Traceback (most recent call last):
  File "attack.py", line 47, in <module>
    import DeepSpeech
  File "DeepSpeech/DeepSpeech.py", line 21, in <module>
    from tensorflow.contrib.session_bundle import exporter
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/__init__.py", line 33, in <module>
    from tensorflow.contrib import cudnn_rnn
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/__init__.py", line 34, in <module>
    from tensorflow.contrib.cudnn_rnn.python.layers import *
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/python/layers/__init__.py", line 23, in <module>
    from tensorflow.contrib.cudnn_rnn.python.layers.cudnn_rnn import *
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py", line 20, in <module>
    from tensorflow.contrib.cudnn_rnn.python.ops import cudnn_rnn_ops
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py", line 21, in <module>
    from tensorflow.contrib.rnn.python.ops import lstm_ops
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/rnn/__init__.py", line 91, in <module>
    from tensorflow.contrib.rnn.python.ops.rnn_cell import *
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/rnn/python/ops/rnn_cell.py", line 24, in <module>
    from tensorflow.contrib.layers.python.layers import layers
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/layers/__init__.py", line 116, in <module>
    from tensorflow.contrib.layers.python.layers import *
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/__init__.py", line 33, in <module>
    from tensorflow.contrib.layers.python.layers.target_column import *
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/target_column.py", line 24, in <module>
    from tensorflow.contrib.losses.python.losses import loss_ops
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/losses/__init__.py", line 25, in <module>
    from tensorflow.contrib.losses.python import metric_learning
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/losses/python/metric_learning/__init__.py", line 25, in <module>
    from tensorflow.contrib.losses.python.metric_learning.metric_loss_ops import *
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/tensorflow/contrib/losses/python/metric_learning/metric_loss_ops.py", line 34, in <module>
    from sklearn import metrics
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/sklearn/__init__.py", line 82, in <module>
    from .base import clone
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/sklearn/base.py", line 17, in <module>
    from .utils import _IS_32BIT
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/sklearn/utils/__init__.py", line 23, in <module>
    from .class_weight import compute_class_weight, compute_sample_weight
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/sklearn/utils/class_weight.py", line 7, in <module>
    from .validation import _deprecate_positional_args
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/sklearn/utils/validation.py", line 26, in <module>
    from .fixes import _object_dtype_isnan, parse_version
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/sklearn/utils/fixes.py", line 28, in <module>
    from pkg_resources import parse_version  # type: ignore
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3242, in <module>
    @_call_aside
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3270, in _initialize_master_working_set
    for dist in working_set
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3270, in <genexpr>
    for dist in working_set
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2781, in activate
    for pkg in self._get_metadata('namespace_packages.txt'):
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2765, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1417, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1407, in get_metadata
    value = self._get(path)
  File "/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1611, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/home/zjh/anaconda3/envs/rba/lib/python3.6/site-packages/zipp-3.6.0.dist-info/namespace_packages.txt'

I use tensorflow-cpu 1.8.0 and I wonder whether it is the cause.

hiromu commented 2 years ago

I could not reproduce this error, but from the message, I guess that your installation of zipp has failed. Reinstalling zipp via pip install -U zipp may solve it.

Xiaohui319 commented 2 years ago

Now I have this problem too, have you solved it?