audio_adversarial_examples icon indicating copy to clipboard operation
audio_adversarial_examples copied to clipboard

AttributeError: module 'DeepSpeech' has no attribute 'create_flags'

Open Jackjiang313 opened this issue 4 years ago • 3 comments

Hello,

When I run " python3 classify.py --in sample-000000.wav --restore_path ../deepspeech-0.4.1-checkpoint/model.v0.4.1", I got this error.

Jackjiang313 avatar Jun 06 '20 09:06 Jackjiang313

I don't know what causes the issue, but it seems to be related to your DeepSpeech setup. DeepSpeech gets set up automatically if you use the code on my fork: https://github.com/tom-doerr/audio_adversarial_examples

tom-doerr avatar Jun 06 '20 12:06 tom-doerr

Thanks TOM, I have run it successfully using your docker image.

Jackjiang313 avatar Jun 08 '20 02:06 Jackjiang313

commenting here, in case this helps others. I think the reason you get the error 'DeepSpeech' has no attribute 'create_flags' is because you might be running this code in tensorflow 2 environment in which the deepspeech package does not get imported correctly since version 0.41 is meant to be used in tensorflow 1. the fix is to use tensorflow 1 or use below 2 lines to have same effect.

import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

manjitullal avatar Nov 17 '21 22:11 manjitullal