You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
538 B

  1. #include <iostream>
  2. #include <onnxruntime/onnxruntime.h>
  3. #include <onnxruntime/core/session/onnxruntime_session.h>
  4. #include <onnxruntime/core/provider/cpu/cpu_provider_factory.h>
  5. using namespace std;
  6. using namespace onnxruntime;
  7. int main() {
  8. // 初始化ONNX Runtime
  9. OrtSessionOptions session_options;
  10. session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_ALL);
  11. session_options.SetExecutionProvider_CPU(true);
  12. OrtSession session(session_options);
  13. printf("Run ONNX Done..")
  14. return 0;
  15. }