Skip to content

Commit 82a87b1

Browse files
committed
Update run_pretrained_models.py
1 parent 9743c05 commit 82a87b1

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/run_pretrained_models.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,16 @@ def run_test(self, name, backend="caffe2", onnx_file=None, opset=None, extra_ops
248248
elif self.model_type in ["saved_model"]:
249249
try:
250250
res = tf_loader.from_saved_model(
251-
model_path, input_names, outputs, self.tag, self.signatures, self.concrete_function, self.large_model)
251+
model_path, input_names, outputs, self.tag, self.signatures,
252+
self.concrete_function, self.large_model)
252253
except OSError:
253254
model_path = dir_name
254255
logger.info("Load model(2) from %r", model_path)
255256
res = tf_loader.from_saved_model(
256-
model_path, input_names, outputs, self.tag, self.signatures, self.concrete_function, self.large_model)
257-
if len(res) == 5:
258-
graph_def, input_names, outputs, concrete_func, imported = res
259-
elif len(res) == 3:
260-
graph_def, input_names, outputs = res
261-
concrete_func, imported = None, None
262-
else:
263-
raise OSError("Unexpected number of results %r." % len(res))
257+
model_path, input_names, outputs, self.tag, self.signatures,
258+
self.concrete_function, self.large_model)
259+
# graph_def, input_names, outputs, concrete_func, imported = res
260+
graph_def, input_names, outputs = res[:3]
264261
elif self.model_type in ["keras"]:
265262
graph_def, input_names, outputs = tf_loader.from_keras(model_path, input_names, outputs)
266263
else:

0 commit comments

Comments
 (0)