Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tensorflow/compiler/mlir/lite/schema/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 19 additions & 6 deletions tensorflow/lite/micro/tools/benchmarking/collect_meta_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion tensorflow/lite/schema/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
Loading