Tensor shapes mismatch during running `lm_optimizer.py`

The error is like:

(np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (400,) for Tensor 'cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/bias/Initializer/Const:0', which has shape '(8192,)'e

Here is how I train the models:

Train kenlm

python $DSPEECH/data/lm/generate_lm.py \
    --input_txt data/text.txt --output_dir models/ \
    --top_k 500000 --kenlm_bins $DSPEECH/kenlm/build/bin/ \
    --arpa_order 5 --max_arpa_memory "85%" --arpa_prune "0|0|1" \
    --binary_a_bits 255 --binary_q_bits 8 --binary_type trie

Train STT model

python $DSPEECH/DeepSpeech.py \
    --alphabet_config_path data/alphabet.txt \
    --train_files data/train.csv \
    --dev_files data/dev.csv \
    --test_files data/test.csv \
    --audio_sample_rate 16000 \
    --epochs 300 \
    --train_batch_size 12 \
    --test_batch_size 12 \
    --n_hidden 2048 \
    --checkpoint_dir checkpoints/1st-run/ \
    --export_dir models/1st-run/ \
    --scorer models/kenlm.scorer \
    --report_count 20 \
    --log_level 0
    "$@"

Optimize LM

python $DSPEECH/lm_optimizer.py \
    --test_files data/dev.csv \
    --alphabet_config_path data/alphabet.txt \
    --scorer_path models/kenlm.scorer \
    --checkpoint_dir checkpoints/1st-run \
    --log_level 0

This is the full log produced by running lm_optimizer.py

log.txt

Please HELP, thank you!

you pass no lm_alpha_max, no lm_beta_max, no model shape n_hidden and no n_trials.

please follow the guidelines and share more infos on what you do, and read the docs.

400=4*100 ; 8192=4*2048 are you certain you are running on the checkpoint you think you are?

1 Like

Thank You @lissyx . I passed a wrong checkpoints. :grinning:

1 Like