Custom LM causes terrible false positive rate

I thought you had downloaded and imported LibriSpeech already? Just follow that example. There’s also bin/import_ldc93s1.sh for a single sample dataset.

@MattC_eostar I’m now enclined to think you are just a victim of https://github.com/mozilla/DeepSpeech/issues/2612

Local testing for me would match very closely your report.

@lissyx

I saw that thread started yesterday. I plan on pulling down the alpha15 TFLite model and seeing what improvements that may cause for our use case. Will the 0.5.1 checkpoint converted to TFLite using 0.6.0 work properly in the v0.6.0 or will I need change other stuff as well?

Going to pull model from here: https://github.com/lissyx/DeepSpeech/releases/tag/v0.6.0-alpha.15

No, but we landed the proper fix on v0.6.0. This requires model re-export and a new release, and we have a few other bugfix that could benefit from a 0.6.1. Also, since it’s holidays, we’ll delay that.

Just take the official 0.6.0 model, use current master of the tree to perform a TFLite re-export.

Awesome. I will do that. Thank you!

1 Like

So I switched to master and made sure all dependencies were installed. Was getting an attribute error from gast, but downgrading to 0.2.2 fixed that, but now the checkpoint loader is returning None.

I downloaded the checkpoint from the 0.6.0 release.

My command is

python DeepSpeech.py --checkpoint_dir ./model/deepspeech-0.6.0-checkpoint/ --export_tflite --export_dir ./model --lm ./model/lm.binary --trie ./model/trie

and the error:

I Exporting the model...
WARNING:tensorflow:From DeepSpeech.py:705: The name tf.nn.rnn_cell.LSTMStateTuple is deprecated. Please use tf.compat.v1.nn.rnn_cell.LSTMStateTuple instead.

W1220 11:01:21.922978 4594513344 deprecation_wrapper.py:119] From DeepSpeech.py:705: The name tf.nn.rnn_cell.LSTMStateTuple is deprecated. Please use tf.compat.v1.nn.rnn_cell.LSTMStateTuple instead.

WARNING:tensorflow:From DeepSpeech.py:131: LSTMCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.
W1220 11:01:22.023649 4594513344 deprecation.py:323] From DeepSpeech.py:131: LSTMCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.
WARNING:tensorflow:From DeepSpeech.py:141: static_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `keras.layers.RNN(cell, unroll=True)`, which is equivalent to this API
W1220 11:01:22.108879 4594513344 deprecation.py:323] From DeepSpeech.py:141: static_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `keras.layers.RNN(cell, unroll=True)`, which is equivalent to this API
WARNING:tensorflow:From /Users/mattc/anaconda3/envs/deepspeech/lib/python3.6/site-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
W1220 11:01:22.118990 4594513344 deprecation.py:506] From /Users/mattc/anaconda3/envs/deepspeech/lib/python3.6/site-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
WARNING:tensorflow:From /Users/mattc/anaconda3/envs/deepspeech/lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py:961: calling Zeros.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
W1220 11:01:22.144685 4594513344 deprecation.py:506] From /Users/mattc/anaconda3/envs/deepspeech/lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py:961: calling Zeros.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
Traceback (most recent call last):
  File "DeepSpeech.py", line 966, in <module>
    absl.app.run(main)
  File "/Users/mattc/anaconda3/envs/deepspeech/lib/python3.6/site-packages/absl/app.py", line 299, in run
    _run_main(main, args)
  File "/Users/mattc/anaconda3/envs/deepspeech/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "DeepSpeech.py", line 947, in main
    export()
  File "DeepSpeech.py", line 805, in export
    checkpoint_path = checkpoint.model_checkpoint_path
AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'

Are you sure you have a checkpoint file in this directory ? Can you verify its content ?

$ ls -al eng/deepspeech-0.6.0-checkpoint/checkpoint 
lrwxrwxrwx 1 alex alex 19 déc.   6 10:41 eng/deepspeech-0.6.0-checkpoint/checkpoint -> best_dev_checkpoint
$ cat eng/deepspeech-0.6.0-checkpoint/checkpoint 
model_checkpoint_path: "best_dev-233784"
all_model_checkpoint_paths: "best_dev-233784"

You might need to symlink like that.

That did it! Thank you. Are the --lm and --trie flags used when converting the model? I looked at the code and it didn’t seem like it.

Rerunning the GA with the new model to see what minimal WER I can get.

They are not.

Good, I hope it will help in your case. Just be cautious to have used the proper master that contains the fix :slight_smile:

Saw your fix in the git log after pulling and switching to master so fingers crossed!

2 Likes