Skip to content

Instantly share code, notes, and snippets.

@nmstoker
Created October 4, 2017 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmstoker/780bbf16a199007e3dff594f22e36d04 to your computer and use it in GitHub Desktop.
Save nmstoker/780bbf16a199007e3dff594f22e36d04 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -xe
if [ ! -f DeepSpeech.py ]; then
echo "Please make sure you run this from DeepSpeech's top level directory."
exit 1
fi;
if [ ! -d "${COMPUTE_DATA_DIR}" ]; then
COMPUTE_DATA_DIR="/path-to-your-files/data"
fi;
# Warn if we can't find the train files
if [ ! -f "${COMPUTE_DATA_DIR}/train.csv" ]; then
echo "Warning: It looks like you don't have the corpus" \
"downloaded and preprocessed. Make sure \$COMPUTE_DATA_DIR points to the" \
"folder where the data is located, and that you ran the" \
"importer script at import_S3_files.py before running this script."
fi;
if [ -d "${COMPUTE_KEEP_DIR}" ]; then
checkpoint_dir=$COMPUTE_KEEP_DIR
else
checkpoint_dir=$(python -c 'from xdg import BaseDirectory as xdg; print(xdg.save_data_path("deepspeech/yourname"))')
fi
python -u DeepSpeech.py \
--train_files "$COMPUTE_DATA_DIR/train.csv" \
--dev_files "$COMPUTE_DATA_DIR/dev.csv" \
--test_files "$COMPUTE_DATA_DIR/test.csv" \
--train_batch_size 12 \
--dev_batch_size 12 \
--test_batch_size 12 \
--learning_rate 0.0001 \
--epoch 95 \
--display_step 5 \
--validation_step 5 \
--dropout_rate 0.30 \
--default_stddev 0.046875 \
--export_dir "/path-to-your-files/models" \
--checkpoint_dir "$checkpoint_dir" \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment