File size: 567 Bytes
eef0ae4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import onnxruntime as ort
session = ort.InferenceSession("onnx/frida-onnx/FRIDA.onnx")
for i, inp in enumerate(session.get_inputs()):
print(f"Input {i}:")
print(f" Name: {inp.name}")
print(f" Type: {inp.type}")
print(f" Shape: {inp.shape}")
print(f" Is dynamic? {'Yes' if -1 in inp.shape else 'No'}")
for i, out in enumerate(session.get_outputs()):
print(f"Output {i}:")
print(f" Name: {out.name}")
print(f" Type: {out.type}")
print(f" Shape: {out.shape}")
print(f" Is dynamic? {'Yes' if -1 in out.shape else 'No'}") |