AttributeError: module 'tensorflow' has no attribute 'app'

(Shaikh Zhas) #1

I ran this script:

python \

--train_files "/home/dulan/data/train.csv" \
--dev_files "/home/dulan/data/dev.csv" \
--test_files "/home/dulan/data/test.csv" \
--train_batch_size 32 \
--dev_batch_size 32 \
--test_batch_size 32 \
--epoch 1 \
--dropout_rate 0.22 \
--learning_rate 0.00095 \
--alphabet_config_path "/home/dulan/models/alphabet.txt"\
--lm_binary_path "/home/dulan/models/lm.binary" \
--lm_trie_path "/home/dulan/models/trie" \
--word_count_weight 3.5 \
--log_level 1 \
--display_step 1 \
--export_dir "/home/dulan/models"

And get this error:

AttributeError: module ‘tensorflow’ has no attribute ‘app’
./ line 5: --train_file: command not found

Something wrong with Tensorflow, I have installed tensorflow in this way:
pip3 install ‘tensorflow-gpu==1.12.0’

How I can fix this problem ?



(Lissyx) #2

Your TensorFlow install is obviously wrong. There’s nothing we can do more than telling you to start over from a clean virtualenv.



I had the same problem over here!
You have to use python3.5 to use tensorflow 1.12.0.

I made my virtualenv with (mini-)conda (
Just install and run:

conda create -n deepspeech-venv python=3.5

afterwards, run

conda activate deepspeech-venv

and follow the installation-process described here:

1 Like

(Carlos Fonseca) #4

Running this command to force GPU version to reinstall fixed the issue for me:

pip3 install --upgrade --force-reinstall tensorflow-gpu