Skip to content
Discussion options

You must be logged in to vote

I managed to get sameish outputs when comparing the output of the trained model and the ONNX export in the debugger.

dataset = PredictDataset(path=TEST_IMAGE_PATH)

predictions = engine.predict(
        model=model,
        dataset=dataset,
    )

and the resulting ONNX export using the following code

def validate_onnx_export(onnx_path: Path, sample_image_path: Path, input_size: tuple[int, int] = (256, 256)):
    """Run ONNXRuntime inference on one sample image to validate exported model."""
    print(f"Validating ONNX model with ONNXRuntime: {onnx_path}")

    session = ort.InferenceSession(str(onnx_path), providers=["CPUExecutionProvider"])
    input_meta = session.get_inputs()[0]

    #…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ashwinvaidya17
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants