Fix shape of loaded preprocessed features

This commit is contained in:
Reuben Morais 2019-02-12 16:17:25 -02:00
Родитель afcf7dbf54
Коммит c1212ffbb2
3 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -14,6 +14,7 @@ fi;
python -u DeepSpeech.py \
--train_files ${ldc93s1_csv} --train_batch_size 1 \
--train_cached_features_path "/tmp/ldc93s1.hdf5" \
--dev_files ${ldc93s1_csv} --dev_batch_size 1 \
--test_files ${ldc93s1_csv} --test_batch_size 1 \
--n_hidden 494 --epoch $epoch_count --random_seed 4567 \

Просмотреть файл

@ -56,6 +56,8 @@ decoder_pkg_url=${DECODER_ARTIFACTS_ROOT}/${decoder_pkg}
LD_LIBRARY_PATH=${PY37_LDPATH}:$LD_LIBRARY_PATH pip install --verbose --only-binary :all: ${PY37_SOURCE_PACKAGE} --upgrade ${decoder_pkg_url} | cat
pushd ${HOME}/DeepSpeech/ds/
# Run twice to test preprocessed features
time ./bin/run-tc-ldc93s1_new.sh 104
time ./bin/run-tc-ldc93s1_new.sh 105
time ./bin/run-tc-ldc93s1_tflite.sh
popd

Просмотреть файл

@ -41,10 +41,9 @@ def preprocess(csv_files, batch_size, numcep, numcontext, alphabet, hdf5_cache_p
transcript = file.root.transcript[:]
transcript_len = file.root.transcript_len[:]
# features are stored flattened, so reshape into
# [n_steps, (n_input + 2*n_context*n_input)]
# features are stored flattened, so reshape into [n_steps, numcep]
for i in range(len(features)):
features[i] = np.reshape(features[i], [features_len[i], -1])
features[i].shape = [features_len[i]+2*numcontext, numcep]
in_data = list(zip(features, features_len,
transcript, transcript_len))