shehzeen / waveguard_defense

This is the codebase for defense framework described in USENIX '21 paper "WaveGuard: Understanding and Mitigating Audio Adversarial Examples"
15 stars 6 forks source link

An error problem about the code #5

Closed wzhlovepy closed 2 years ago

wzhlovepy commented 2 years ago

Hello, I'm studying your article. I encountered an error when reading the code. In the file spectral.py, I variable error. In addition, what version of deepspeech do you use? if axis is None: ndims = t.get_shape().ndims if ndims is None: raise ValueError('Cannot run on tensor with dynamic ndims') dims = [] for i in range(ndims): try: dim = int(t.get_shape()[i]) except: dim = tf.shape(t)[i] dims.append(dim) return dims else: try: dim = int(t.get_shape()[axis]) except: dim = tf.shape(t)[i] // The variable I here is not clear return dim

paarthneekhara commented 2 years ago

Your code should not be going into that else statement since best_shape is called in two places and in both the calls "axis" is None. Also, version of Deepspeech is DeepSpeech 0.4.1. Installation instructions can be found here https://github.com/carlini/audio_adversarial_examples