zamroni111's picture
Upload 2 files
6e510b3 verified
raw
history blame contribute delete
552 Bytes
import onnxruntime as rt
sess_options = rt.SessionOptions()
sess_options.graph_optimization_level = rt.GraphOptimizationLevel.ORT_ENABLE_ALL
#########################################
## Change the Path Accordingly
sess_options.optimized_model_filepath = "d:/tmp/optimized_model.onnx"
#########################################
## Change the model.onnx path accordingly
session = rt.InferenceSession("model.onnx" , sess_options,
###providers=['xxxxxxxxxDmlExecutionProvider', 'CPUExecutionProvider'])
providers=['DmlExecutionProvider'])