Skip to content

Instantly share code, notes, and snippets.

@skyline75489
Created May 26, 2022 03:59
Show Gist options
  • Save skyline75489/a082a53b68f5ae194ba28ee52bfb45a4 to your computer and use it in GitHub Desktop.
Save skyline75489/a082a53b68f5ae194ba28ee52bfb45a4 to your computer and use it in GitHub Desktop.
import onnx
import onnxruntime as ort
import numpy as np
from onnx import numpy_helper
new_onnx_file_path='./model.onnx'
ort_sess = ort.InferenceSession(new_onnx_file_path)
input_ids_ts=onnx.TensorProto()
input_ids_ts.ParseFromString(open('test_data_set_0\input_0.pb','rb').read())
input_ids = numpy_helper.to_array(input_ids_ts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment