Skip to content
This repository was archived by the owner on May 12, 2024. It is now read-only.

Commit 55cbd58

Browse files
committed
Support for AutoML Reshape, Myrid sort_result_descending=false
1 parent c4bb7fe commit 55cbd58

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG CPVER=cp38
77
ARG OPENVINOVER=2021.4.582
88
ARG OPENVINOROOTDIR=/opt/intel/openvino_2021
99
ARG TENSORRTVER=cuda11.3-trt8.0.1.6-ga-20210626
10-
ARG APPVER=v1.13.3
10+
ARG APPVER=v1.13.4
1111
ARG wkdir=/home/user
1212

1313
# dash -> bash

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
setup(
1212
name="tflite2tensorflow",
1313
scripts=scripts,
14-
version="1.13.3",
14+
version="1.13.4",
1515
description="Generate saved_model, tfjs, tf-trt, EdgeTPU, CoreML, quantized tflite, ONNX, OpenVINO, Myriad Inference Engine blob and .pb from .tflite.",
1616
long_description=long_description,
1717
long_description_content_type="text/markdown",

tflite2tensorflow/tflite2tensorflow.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,12 @@ def searh_json_tensor_detail(name):
916916
try:
917917
options = op['builtin_options']
918918
new_shape = options['new_shape']
919+
if new_shape == []:
920+
shape_detail = interpreter._get_tensor_details(op['inputs'][1])
921+
if shape_detail['shape'] != [0]:
922+
new_shape = interpreter.get_tensor(shape_detail['index'])
923+
else:
924+
new_shape = []
919925
except:
920926
try:
921927
new_shape = tensors[op['inputs'][1]]
@@ -6180,6 +6186,15 @@ def input_fn():
61806186
print(f'{Color.REVERCE}Myriad Inference Engine blob convertion started{Color.RESET}', '=' * 44)
61816187
os.makedirs(f'{model_output_path}/openvino/myriad', exist_ok=True)
61826188
INTEL_OPENVINO_DIR = os.environ['INTEL_OPENVINO_DIR']
6189+
6190+
shutil.copy(f'{model_output_path}/openvino/FP16/saved_model.xml', f'{model_output_path}/openvino/FP16/saved_model_vino.xml')
6191+
result = subprocess.check_output(
6192+
[
6193+
"sed", "-i", 's/sort_result_descending=\"true\"/sort_result_descending=\"false\"/g', f"{model_output_path}/openvino/FP16/saved_model.xml"
6194+
],
6195+
stderr=subprocess.PIPE
6196+
).decode('utf-8')
6197+
61836198
result = subprocess.check_output(
61846199
[
61856200
f'{INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/lib/intel64/myriad_compile',
@@ -6191,7 +6206,11 @@ def input_fn():
61916206
stderr=subprocess.PIPE
61926207
).decode('utf-8')
61936208
print(result)
6209+
shutil.copy(f'{model_output_path}/openvino/FP16/saved_model.xml', f'{model_output_path}/openvino/FP16/saved_model_myriad.xml')
6210+
shutil.copy(f'{model_output_path}/openvino/FP16/saved_model_vino.xml', f'{model_output_path}/openvino/FP16/saved_model.xml')
6211+
61946212
print(f'{Color.GREEN}Myriad Inference Engine blob convertion complete!{Color.RESET} - {model_output_path}/openvino/myriad')
6213+
61956214
except subprocess.CalledProcessError as e:
61966215
print(f'{Color.RED}ERROR:{Color.RESET}', e.stderr.decode('utf-8'))
61976216
import traceback

0 commit comments

Comments
 (0)