Skip to content

Commit

Permalink
check_path
Browse files Browse the repository at this point in the history
Signed-off-by: jcwchen <[email protected]>
  • Loading branch information
jcwchen committed Jul 13, 2023
1 parent e1690be commit d466f26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions workflow_scripts/check_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def has_vnni_support():

def run_onnx_checker(model_path):
model = onnx.load(model_path)
onnx.checker.check_model(model, full_check=True)
del model
onnx.checker.check_model(model_path, full_check=True)


def ort_skip_reason(model_path):
Expand Down Expand Up @@ -48,8 +48,7 @@ def run_backend_ort(model_path, test_data_set=None, tar_gz_path=None):
# based on the build flags) when instantiating InferenceSession.
# For example, if NVIDIA GPU is available and ORT Python package is built with CUDA, then call API as following:
# onnxruntime.InferenceSession(path/to/model, providers=["CUDAExecutionProvider"])
sess = onnxruntime.InferenceSession(model_path)
del sess
onnxruntime.InferenceSession(model_path)
# Get model name without .onnx
model_name = os.path.basename(os.path.splitext(model_path)[0])
if model_name is None:
Expand Down
3 changes: 0 additions & 3 deletions workflow_scripts/ort_test_dir_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def save_data(prefix, name_data_map, model_info):
name_output_map = {}
for name, data in zip(output_names, outputs):
name_output_map[name] = data
del sess

save_data("output", name_output_map, model_outputs)

Expand Down Expand Up @@ -263,8 +262,6 @@ def run_test_dir(model_or_dir):
print("Mismatch for {}:\nExpected:{}\nGot:{}".format(output_names[idx], expected, actual))
failed = True
if failed:
del sess
raise ValueError("FAILED due to output mismatch.")
else:
print("PASS")
del sess

0 comments on commit d466f26

Please sign in to comment.