Testing TFLite runtime on Linux/macOS/Windows

This commit is contained in:
Alexandre Lissy 2019-06-25 11:08:11 +02:00
parent a9ec2b5cd6
commit ad11e02582
9 changed files with 60 additions and 2 deletions

View File

@ -9,6 +9,7 @@ source $(dirname "$0")/tc-tests-utils.sh
model_source=${DEEPSPEECH_TEST_MODEL//.pb/.tflite}
model_name=$(basename "${model_source}")
export DATA_TMP_DIR=${ANDROID_TMP_DIR}/ds
if [ "${arm_flavor}" = "armeabi-v7a" ]; then
export DEEPSPEECH_ARTIFACTS_ROOT=${DEEPSPEECH_ARTIFACTS_ROOT_ARMV7}

View File

@ -0,0 +1,18 @@
#!/bin/bash
set -xe
source $(dirname "$0")/tc-tests-utils.sh
model_source=${DEEPSPEECH_TEST_MODEL//.pb/.tflite}
model_name=$(basename "${model_source}")
export DEEPSPEECH_ARTIFACTS_ROOT=${DEEPSPEECH_ARTIFACTS_TFLITE_ROOT}
export DATA_TMP_DIR=${TASKCLUSTER_TMP_DIR}
download_material "${TASKCLUSTER_TMP_DIR}/ds"
export PATH=${TASKCLUSTER_TMP_DIR}/ds/:$PATH
check_tensorflow_version
run_tflite_basic_inference_tests

View File

@ -309,12 +309,12 @@ check_runtime_electronjs()
run_tflite_basic_inference_tests()
{
set +e
phrase_pbmodel_nolm=$(${DS_BINARY_PREFIX}deepspeech --model ${ANDROID_TMP_DIR}/ds/${model_name} --alphabet ${ANDROID_TMP_DIR}/ds/alphabet.txt --audio ${ANDROID_TMP_DIR}/ds/LDC93S1.wav 2>${TASKCLUSTER_TMP_DIR}/stderr)
phrase_pbmodel_nolm=$(${DS_BINARY_PREFIX}deepspeech --model ${DATA_TMP_DIR}/${model_name} --alphabet ${DATA_TMP_DIR}/alphabet.txt --audio ${DATA_TMP_DIR}/LDC93S1.wav 2>${TASKCLUSTER_TMP_DIR}/stderr)
set -e
assert_correct_ldc93s1 "${phrase_pbmodel_nolm}" "$?"
set +e
phrase_pbmodel_nolm=$(${DS_BINARY_PREFIX}deepspeech --model ${ANDROID_TMP_DIR}/ds/${model_name} --alphabet ${ANDROID_TMP_DIR}/ds/alphabet.txt --audio ${ANDROID_TMP_DIR}/ds/LDC93S1.wav --extended 2>${TASKCLUSTER_TMP_DIR}/stderr)
phrase_pbmodel_nolm=$(${DS_BINARY_PREFIX}deepspeech --model ${DATA_TMP_DIR}/${model_name} --alphabet ${DATA_TMP_DIR}/alphabet.txt --audio ${DATA_TMP_DIR}/LDC93S1.wav --extended 2>${TASKCLUSTER_TMP_DIR}/stderr)
set -e
assert_correct_ldc93s1 "${phrase_pbmodel_nolm}" "$?"
}

View File

@ -0,0 +1,13 @@
build:
template_file: test-darwin-opt-base.tyml
dependencies:
- "darwin-amd64-tflite-opt"
- "test-training_upstream-linux-amd64-py35m-opt"
system_setup:
>
${cpp.brew.setup} && ${cpp.brew.packages} && ${cpp.brew.env}
args:
tests_cmdline: "$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/taskcluster/tc-cpp_tflite-ds-tests.sh"
metadata:
name: "DeepSpeech OSX AMD64 TFlite C++ tests"
description: "Testing DeepSpeech C++ for OSX/AMD64, TFLite, optimized version"

View File

@ -0,0 +1,10 @@
build:
template_file: test-linux-opt-base.tyml
dependencies:
- "linux-amd64-tflite-opt"
- "test-training_upstream-linux-amd64-py35m-opt"
args:
tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/taskcluster/tc-cpp_tflite-ds-tests.sh"
metadata:
name: "DeepSpeech Linux AMD64 TFLite C++ tests"
description: "Testing DeepSpeech C++ for Linux/AMD64, TFLite, optimized version"

View File

@ -0,0 +1,10 @@
build:
template_file: test-win-opt-base.tyml
dependencies:
- "win-amd64-tflite-opt"
- "test-training_upstream-linux-amd64-py35m-opt"
args:
tests_cmdline: "$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/taskcluster/tc-cpp_tflite-ds-tests.sh"
metadata:
name: "DeepSpeech Windows AMD64 TFLite C++ tests"
description: "Testing DeepSpeech C++ for Windows/AMD64, TFLite, optimized version"

View File

@ -34,9 +34,11 @@ then:
$let:
training: { $eval: as_slugid("test-training_upstream-linux-amd64-py35m-opt") }
darwin_amd64_build: { $eval: as_slugid("darwin-amd64-cpu-opt") }
darwin_amd64_tflite: { $eval: as_slugid("darwin-amd64-tflite-opt") }
node_package_cpu: { $eval: as_slugid("node-package-cpu") }
in:
DEEPSPEECH_ARTIFACTS_ROOT: https://queue.taskcluster.net/v1/task/${darwin_amd64_build}/artifacts/public
DEEPSPEECH_ARTIFACTS_TFLITE_ROOT: https://queue.taskcluster.net/v1/task/${darwin_amd64_tflite}/artifacts/public
DEEPSPEECH_NODEJS: https://queue.taskcluster.net/v1/task/${node_package_cpu}/artifacts/public
DEEPSPEECH_TEST_MODEL: https://queue.taskcluster.net/v1/task/${training}/artifacts/public/output_graph.pb
DEEPSPEECH_PROD_MODEL: https://github.com/reuben/DeepSpeech/releases/download/v0.6.0-alpha.0/output_graph.pb

View File

@ -33,12 +33,14 @@ then:
$let:
training: { $eval: as_slugid("test-training_upstream-linux-amd64-py35m-opt") }
linux_amd64_build: { $eval: as_slugid("linux-amd64-cpu-opt") }
linux_amd64_tflite: { $eval: as_slugid("linux-amd64-tflite-opt") }
linux_amd64_ctc: { $eval: as_slugid("linux-amd64-ctc-opt") }
node_package_cpu: { $eval: as_slugid("node-package-cpu") }
in:
CONVERT_GRAPHDEF_MEMMAPPED: ${build.convert_graphdef}
BENCHMARK_MODEL_BIN: ${build.benchmark_model_bin}
DEEPSPEECH_ARTIFACTS_ROOT: https://queue.taskcluster.net/v1/task/${linux_amd64_build}/artifacts/public
DEEPSPEECH_ARTIFACTS_TFLITE_ROOT: https://queue.taskcluster.net/v1/task/${linux_amd64_tflite}/artifacts/public
DEEPSPEECH_NODEJS: https://queue.taskcluster.net/v1/task/${node_package_cpu}/artifacts/public
DEEPSPEECH_TEST_MODEL: https://queue.taskcluster.net/v1/task/${training}/artifacts/public/output_graph.pb
DEEPSPEECH_PROD_MODEL: https://github.com/reuben/DeepSpeech/releases/download/v0.6.0-alpha.0/output_graph.pb

View File

@ -38,9 +38,11 @@ then:
$let:
training: { $eval: as_slugid("test-training_upstream-linux-amd64-py35m-opt") }
win_amd64_build: { $eval: as_slugid("win-amd64-cpu-opt") }
win_amd64_tflite: { $eval: as_slugid("win-amd64-tflite-opt") }
node_package_cpu: { $eval: as_slugid("node-package-cpu") }
in:
DEEPSPEECH_ARTIFACTS_ROOT: https://queue.taskcluster.net/v1/task/${win_amd64_build}/artifacts/public
DEEPSPEECH_ARTIFACTS_TFLITE_ROOT: https://queue.taskcluster.net/v1/task/${win_amd64_tflite}/artifacts/public
DEEPSPEECH_NODEJS: https://queue.taskcluster.net/v1/task/${node_package_cpu}/artifacts/public
DEEPSPEECH_TEST_MODEL: https://queue.taskcluster.net/v1/task/${training}/artifacts/public/output_graph.pb
DEEPSPEECH_PROD_MODEL: https://github.com/reuben/DeepSpeech/releases/download/v0.6.0-alpha.0/output_graph.pb