Training on Urdu giving eager execution error

Hello,

I am working on creating a speech to text engine for Urdu (Pakistani national language). I am using DeepSpeech 0.9.1 and followed the instructions in the documentation. The execution environment is Colab.

When running the command below, I got an error that I’ve not been able to resolve.

! python3 DeepSpeech.py \
        --drop_source_layers 1 \
        --n_hidden 2048 \
        --alphabet_config_path /content/gdrive/My\ Drive/dataset/UrduAlphabet_newscrawl2.txt \
        --checkpoint_dir /content/gdrive/My\ Drive/dataset/trained_load_checkpoint \
        --train_files  /content/gdrive/My\ Drive/train.csv \
        --dev_files   /content/gdrive/My\ Drive/dev.csv \
        --test_files  /content/gdrive/My\ Drive/test.csv \
        --epochs 10 \
        --train_batch_size 32 \
        --export_dir /content/gdrive/MyDrive/dataset/urdu_trained \
        --export_file_name urdu \
        --test_batch_size 12 \
        --learning_rate 0.00001 \
        --load_cudnn true \
        --reduce_lr_on_plateau true \
        --scorer /content/gdrive/My\ Drive/urdu_lm/kenlm.scorer

The error I am getting is:

I1126 22:10:59.237078 139950181578624 utils.py:141] NumExpr defaulting to 2 threads.
    Traceback (most recent call last):
      File "DeepSpeech.py", line 12, in <module>
        ds_train.run_script()
      File "/content/DeepSpeech/training/deepspeech_training/train.py", line 976, in run_script
        absl.app.run(main)
      File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 300, in run
        _run_main(main, args)
      File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 251, in _run_main
        sys.exit(main(argv))
      File "/content/DeepSpeech/training/deepspeech_training/train.py", line 948, in main
        train()
      File "/content/DeepSpeech/training/deepspeech_training/train.py", line 460, in train
        dropout_rates = [tfv1.placeholder(tf.float32, name='dropout_{}'.format(i)) for i in range(6)]
      File "/content/DeepSpeech/training/deepspeech_training/train.py", line 460, in <listcomp>
        dropout_rates = [tfv1.placeholder(tf.float32, name='dropout_{}'.format(i)) for i in range(6)]
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/array_ops.py", line 2616, in placeholder
        raise RuntimeError("tf.placeholder() is not compatible with "
    RuntimeError: tf.placeholder() is not compatible with eager execution.

I have tried disabling eager execution but it has no effect on this package.

Thank you for your help.

As you don’t share anything about your environment it is hard to tell, look at the guidelines and post accordingly if you want us to help.

You have not setup a virtualenv as documented.

We don’t use that, we can’t provide support.

Hello saima!

i had the exact error and it had been caused by not Restarting the runtime after i updated and installed the latest tensorflow-gpu : ‘tensorflow-gpu==1.15.4’ and also not Restarting the runtime after :

!pip3 install --upgrade pip==20.2.2 wheel==0.34.2 setuptools==49.6.0

!pip3 install --upgrade -e .

it started the training after i restarted my runtime after these.