diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-10-29 13:12:50 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-10-29 13:12:50 +0900 |
commit | d6b371e095d737922187a518b8faba1ef6f3a2b1 (patch) | |
tree | 9d90c09c887b5111389dbedf924f59206411cd5a /compiler/tf2tflite-value-pbtxt-test/testall.sh | |
parent | c55f8a6db48cda9d3a78048338b7f18c4cca62b8 (diff) | |
download | nnfw-d6b371e095d737922187a518b8faba1ef6f3a2b1.tar.gz nnfw-d6b371e095d737922187a518b8faba1ef6f3a2b1.tar.bz2 nnfw-d6b371e095d737922187a518b8faba1ef6f3a2b1.zip |
Imported Upstream version 0.4upstream/0.4
Diffstat (limited to 'compiler/tf2tflite-value-pbtxt-test/testall.sh')
-rwxr-xr-x | compiler/tf2tflite-value-pbtxt-test/testall.sh | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/compiler/tf2tflite-value-pbtxt-test/testall.sh b/compiler/tf2tflite-value-pbtxt-test/testall.sh deleted file mode 100755 index ff18b6058..000000000 --- a/compiler/tf2tflite-value-pbtxt-test/testall.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -# Need at least 2 arguments -if [[ $# -lt 2 ]]; then - echo "USAGE: $0 ..." - echo - echo "ARGUMENTS:" - echo " [test.config path]" - echo " [WORKDIR]" - echo " [Prefix1]" - echo " [Prefix2]" - echo " ..." - exit 255 -fi - -CONFIG_PATH="$1"; shift -WORKDIR="$1"; shift - -source "${CONFIG_PATH}" - -echo "-- Found nnkit-run: ${NNKIT_RUN_PATH}" -echo "-- Found TF backend: ${TF_BACKEND_PATH}" -echo "-- Found TFLITE backend: ${TFLITE_BACKEND_PATH}" -echo "-- Found TF2TFLITE: ${TF2TFLITE_PATH}" -echo "-- Found randomize action: ${RANDOMIZE_ACTION_PATH}" -echo "-- Found HDF5 export action: ${HDF5_EXPORT_ACTION_PATH}" -echo "-- Found HDF5 import action: ${HDF5_IMPORT_ACTION_PATH}" -echo "-- Found i5diff: ${I5DIFF_PATH}" -echo "-- Found workdir: ${WORKDIR}" - -TESTED=() -PASSED=() -FAILED=() - -pushd "${WORKDIR}" -while [[ $# -ne 0 ]]; do - PREFIX="$1"; shift - - TESTED+=("${PREFIX}") - - PASSED_TAG="${PREFIX}.passed" - - rm -f "${PASSED_TAG}" - - cat > "${PREFIX}.log" <( - exec 2>&1 - - echo "-- Found pb: ${PREFIX}.pb" - - # Exit immediately if any command fails - set -e - # Show commands - set -x - - # Generate tflite - "${TF2TFLITE_PATH}" \ - "${WORKDIR}/${PREFIX}.info" \ - "${WORKDIR}/${PREFIX}.pb" \ - "${WORKDIR}/${PREFIX}.tflite" - - # Run TensorFlow - "${NNKIT_RUN_PATH}" \ - --backend "${TF_BACKEND_PATH}" \ - --backend-arg "${WORKDIR}/${PREFIX}.pb" \ - --backend-arg "${WORKDIR}/${PREFIX}.info" \ - --pre "${RANDOMIZE_ACTION_PATH}" \ - --pre "${HDF5_EXPORT_ACTION_PATH}" \ - --pre-arg "${WORKDIR}/${PREFIX}.input.h5" \ - --post "${HDF5_EXPORT_ACTION_PATH}" \ - --post-arg "${WORKDIR}/${PREFIX}.expected.h5" - - # Run TensorFlow Lite - "${NNKIT_RUN_PATH}" \ - --backend "${TFLITE_BACKEND_PATH}" \ - --backend-arg "${WORKDIR}/${PREFIX}.tflite" \ - --pre "${HDF5_IMPORT_ACTION_PATH}" \ - --pre-arg "${WORKDIR}/${PREFIX}.input.h5" \ - --post "${HDF5_EXPORT_ACTION_PATH}" \ - --post-arg "${WORKDIR}/${PREFIX}.obtained.h5" - - "${I5DIFF_PATH}" -d 0.001 "${PREFIX}.expected.h5" "${PREFIX}.obtained.h5" - - if [[ $? -eq 0 ]]; then - touch "${PASSED_TAG}" - fi - ) - - if [[ -f "${PASSED_TAG}" ]]; then - PASSED+=("$PREFIX") - else - FAILED+=("$PREFIX") - fi -done -popd - -if [[ ${#TESTED[@]} -ne ${#PASSED[@]} ]]; then - echo "FAILED" - for TEST in "${FAILED[@]}" - do - echo "- ${TEST}" - done - exit 255 -fi - -echo "PASSED" -exit 0 |