Skip to content

Commit c1212ff

Browse files
committed
Fix shape of loaded preprocessed features
1 parent afcf7db commit c1212ff

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

bin/run-tc-ldc93s1_new.sh

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fi;
1414

1515
python -u DeepSpeech.py \
1616
--train_files ${ldc93s1_csv} --train_batch_size 1 \
17+
--train_cached_features_path "/tmp/ldc93s1.hdf5" \
1718
--dev_files ${ldc93s1_csv} --dev_batch_size 1 \
1819
--test_files ${ldc93s1_csv} --test_batch_size 1 \
1920
--n_hidden 494 --epoch $epoch_count --random_seed 4567 \

tc-train-tests.sh

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ decoder_pkg_url=${DECODER_ARTIFACTS_ROOT}/${decoder_pkg}
5656
LD_LIBRARY_PATH=${PY37_LDPATH}:$LD_LIBRARY_PATH pip install --verbose --only-binary :all: ${PY37_SOURCE_PACKAGE} --upgrade ${decoder_pkg_url} | cat
5757

5858
pushd ${HOME}/DeepSpeech/ds/
59+
# Run twice to test preprocessed features
60+
time ./bin/run-tc-ldc93s1_new.sh 104
5961
time ./bin/run-tc-ldc93s1_new.sh 105
6062
time ./bin/run-tc-ldc93s1_tflite.sh
6163
popd

util/preprocess.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ def preprocess(csv_files, batch_size, numcep, numcontext, alphabet, hdf5_cache_p
4141
transcript = file.root.transcript[:]
4242
transcript_len = file.root.transcript_len[:]
4343

44-
# features are stored flattened, so reshape into
45-
# [n_steps, (n_input + 2*n_context*n_input)]
44+
# features are stored flattened, so reshape into [n_steps, numcep]
4645
for i in range(len(features)):
47-
features[i] = np.reshape(features[i], [features_len[i], -1])
46+
features[i].shape = [features_len[i]+2*numcontext, numcep]
4847

4948
in_data = list(zip(features, features_len,
5049
transcript, transcript_len))

0 commit comments

Comments
 (0)