class_docstr: ```
  Abstract class to preprocess data
  ```
class_docstr_tok: ["``","`","Abstract","class","to","preprocess","data","``","`"]
docstr: ```
  Creates ONNX inference session from provided onnx_model_path
  ```
docstr_tok: ["``","`","Creates","ONNX","inference","session","from","provided","onnx_model_path","``","`"]
code: def create_onnx_session(
      self, onnx_model_path, provider="CPUExecutionProvider"
  ):
      """
      ```
      Creates ONNX inference session from provided onnx_model_path
      ```
      """
  
      from onnxruntime import (
          GraphOptimizationLevel,
          InferenceSession,
          SessionOptions,
          get_all_providers,
      )
  
      assert (
          provider in get_all_providers()
      ), f"provider {provider} not found, {get_all_providers()}"
  
      # Few properties that might have an impact on performances (provided by MS)
      options = SessionOptions()
      options.intra_op_num_threads = 0
      options.graph_optimization_level = (
          GraphOptimizationLevel.ORT_ENABLE_ALL
      )
  
      # Load the model as a graph and prepare the CPU backend
      session = InferenceSession(
          onnx_model_path, options, providers=[provider]
      )
      session.disable_fallback()
  
      # if 'OMP_NUM_THREADS' not in os.environ or 'OMP_WAIT_POLICY' not in os.environ:
      # warnings.warn('''We recommend adding the following at top of script for CPU inference:
  
      # from psutil import cpu_count
      ##Constants from the performance optimization available in onnxruntime
      ##It needs to be done before importing onnxruntime
      # os.environ["OMP_NUM_THREADS"] = str(cpu_count(logical=True))
      # os.environ["OMP_WAIT_POLICY"] = 'ACTIVE'
      #''')
      return session
  
file_path: ktrain/ktrain/predictor.py
imports: from .None import utils
  from .imports import *
label_desc: Use image node_id 10 for calling the Predictor obj's underlying member method code with example usage: obj.create_onnx_session(onnx_model_path, provider) and returns: session