rtaori / Black-Box-Audio

Targeted Adversarial Examples for Black Box Audio Systems
MIT License
67 stars 30 forks source link

transpose dimension problem #9

Closed ruby11dog closed 4 years ago

ruby11dog commented 4 years ago

Hi, i fixed some problems yet, but this one i can't fix it, can you help me about it? When i run

run_audio_attack.py

Traceback (most recent call last): File "run_audio_attack.py", line 256, in g = Genetic(inp_wav_file, out_wav_file, target) File "run_audio_attack.py", line 126, in init self.funcs = self.setup_graph(self.pop, np.array([toks.index(x) for x in target_phrase])) File "run_audio_attack.py", line 147, in setup_graph logits = get_logits(inputs, arg2_logits) File "/mj/Black-Box-Audio/tf_logits.py", line 106, in get_logits logits = DeepSpeech.BiRNN(features, length, [0]*10) File "DeepSpeech/DeepSpeech.py", line 78, in BiRNN batch_x = tf.transpose(batch_x, [1, 0, 2, 3])

ValueError: Dimension must be 3 but is 4 for 'transpose' (op: 'Transpose') with input shapes: [100,95,494], [4].

rtaori commented 4 years ago

Could you try reverting to deepspeech commit 7cc8382de8d876bb5932b0b25ee50a71e9f4fbba ?

ruby11dog commented 4 years ago

ValueError: Input tensor 'ExpandDims:0' enters the loop with shape (1, 11), but has shape (1, ?) after one iteration. To allow the shape to vary across iterations, use the shape_invarian ts argument of tf.while_loop to specify a less-specific shape. I don't think the 7cc8382de8d876bb5932b0b25ee50a71e9f4fbba is the correct version you build on.

ruby11dog commented 4 years ago

can you run your code on deepspeech 7cc8382de8d876bb5932b0b25ee50a71e9f4fbba? if you can, plz let me know! thx

1Jyfc commented 4 years ago

Hi, I met the same problem as ruby11dog said, I'm looking forward to your result on 7cc8382de8d876bb5932b0b25ee50a71e9f4fbba, thx

Xuanghdu commented 4 years ago

Hello! I ran into the same problem as well.

Exception has occurred: ValueError Input tensor 'ExpandDims:0' enters the loop with shape (1, 11), but has shape (1, ?) after one iteration. To allow the shape to vary across iterations, use the shape_invariants argument of tf.while_loop to specify a less-specific shape.

I am on 7cc8382de8d876bb5932b0b25ee50a71e9f4fbba. Looking forward to any solutions. Thanks!

myhappycity commented 4 years ago

Hi! I had the same problem as the first question,ValueError: Dimension must be 3 but is 4 for 'transpose' (op: 'Transpose') with input shapes: [100,95,494], [4] as i run "run_audio_attack.py",I want to know how do you solve this problem@ruby11dog,thank you very much!

rtaori commented 4 years ago

Hi @ruby11dog @1Jyfc @Xuanghdu @hohaiyth,

I have updated the installation instructions with much more detail in the README. Please follow the steps there and open another issue if you still have any problems.

jwwc commented 4 years ago

Hi @ruby11dog @1Jyfc @Xuanghdu @hohaiyth,

I have updated the installation instructions with much more detail in the README. Please follow the steps there and open another issue if you still have any problems.

It works, thx for that!