@@ -916,6 +916,12 @@ def searh_json_tensor_detail(name):
916
916
try :
917
917
options = op ['builtin_options' ]
918
918
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 = []
919
925
except :
920
926
try :
921
927
new_shape = tensors [op ['inputs' ][1 ]]
@@ -6180,6 +6186,15 @@ def input_fn():
6180
6186
print (f'{ Color .REVERCE } Myriad Inference Engine blob convertion started{ Color .RESET } ' , '=' * 44 )
6181
6187
os .makedirs (f'{ model_output_path } /openvino/myriad' , exist_ok = True )
6182
6188
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
+
6183
6198
result = subprocess .check_output (
6184
6199
[
6185
6200
f'{ INTEL_OPENVINO_DIR } /deployment_tools/inference_engine/lib/intel64/myriad_compile' ,
@@ -6191,7 +6206,11 @@ def input_fn():
6191
6206
stderr = subprocess .PIPE
6192
6207
).decode ('utf-8' )
6193
6208
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
+
6194
6212
print (f'{ Color .GREEN } Myriad Inference Engine blob convertion complete!{ Color .RESET } - { model_output_path } /openvino/myriad' )
6213
+
6195
6214
except subprocess .CalledProcessError as e :
6196
6215
print (f'{ Color .RED } ERROR:{ Color .RESET } ' , e .stderr .decode ('utf-8' ))
6197
6216
import traceback
0 commit comments