From 817fdfe10d70672344a637b8bd9eb25fc6f71866 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Sat, 24 Jan 2026 11:35:46 -0800 Subject: [PATCH] More fix --- .github/workflows/test_windows.yml | 1 + tensorflow/compiler/mlir/lite/schema/BUILD | 5 +++- .../tools/benchmarking/collect_meta_data.sh | 25 ++++++++++++++----- tensorflow/lite/schema/BUILD | 5 +++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_windows.yml b/.github/workflows/test_windows.yml index 368124002c3..941c27b011f 100644 --- a/.github/workflows/test_windows.yml +++ b/.github/workflows/test_windows.yml @@ -50,6 +50,7 @@ jobs: mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-pillow mingw-w64-x86_64-python-numpy + mingw-w64-x86_64-python-absl-py openssl tar unzip diff --git a/tensorflow/compiler/mlir/lite/schema/BUILD b/tensorflow/compiler/mlir/lite/schema/BUILD index 71437e695af..c9bfa7298ef 100644 --- a/tensorflow/compiler/mlir/lite/schema/BUILD +++ b/tensorflow/compiler/mlir/lite/schema/BUILD @@ -33,7 +33,10 @@ flatbuffer_cc_library( cc_library( name = "schema_utils", srcs = ["schema_utils.cc"], - hdrs = ["schema_utils.h"], + hdrs = [ + "schema_generated.h", + "schema_utils.h", + ], deps = [ ":schema_fbs", "//tensorflow/compiler/mlir/lite/kernels/internal:compatibility_macros", diff --git a/tensorflow/lite/micro/tools/benchmarking/collect_meta_data.sh b/tensorflow/lite/micro/tools/benchmarking/collect_meta_data.sh index 424a1b8da65..233975150df 100755 --- a/tensorflow/lite/micro/tools/benchmarking/collect_meta_data.sh +++ b/tensorflow/lite/micro/tools/benchmarking/collect_meta_data.sh @@ -77,14 +77,27 @@ cp -p ${TEMPLATE_FILE} ${GENERATED_FILE} # model analysis and SHA1 if [[ ${MODEL_FILE} ]]; then - python3 -m pip install absl-py tensorflow - result=$(python3 \ - "${TENSORFLOW_ROOT}tensorflow/lite/micro/tools/benchmarking/analyze_model.py" \ - --model_file="${MODEL_FILE}" \ - ) + # Try to install dependencies, but don't fail if it doesn't work. + # Some environments (like MSYS2) are externally managed and don't allow pip install. + python3 -m pip install absl-py tensorflow || true + + if python3 -c "import absl, tensorflow" > /dev/null 2>&1; then + result=$(python3 \ + "${TENSORFLOW_ROOT}tensorflow/lite/micro/tools/benchmarking/analyze_model.py" \ + --model_file="${MODEL_FILE}" \ + ) + else + result="Model analysis not available (missing absl-py or tensorflow)" + fi substitute_strings model_analysis_strings "${result}" - result=$(shasum -b "${MODEL_FILE}" | cut -f 1 -d ' ') + if command -v shasum > /dev/null; then + result=$(shasum -b "${MODEL_FILE}" | cut -f 1 -d ' ') + elif command -v md5sum > /dev/null; then + result=$(md5sum -b "${MODEL_FILE}" | cut -f 1 -d ' ') + else + result="SHA1 not available" + fi substitute_strings model_sha1_strings "${result}" fi diff --git a/tensorflow/lite/schema/BUILD b/tensorflow/lite/schema/BUILD index cdd766ffa4e..ba539182a2c 100644 --- a/tensorflow/lite/schema/BUILD +++ b/tensorflow/lite/schema/BUILD @@ -30,7 +30,10 @@ flatbuffer_cc_library( cc_library( name = "schema_utils", - hdrs = ["schema_utils.h"], + hdrs = [ + "schema_generated.h", + "schema_utils.h", + ], deps = [ "//tensorflow/compiler/mlir/lite/schema:schema_utils", ],