Skip to content

Commit

Permalink
兼容 1.14 及以下 onnxruntime 的版本信息打印
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxi-scut committed Jun 13, 2024
1 parent 2328a40 commit 50b16f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/ml/src/ort/ort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ std::any OnnxNet::inference(const std::vector<cv::Mat> &images, const Preprocess
void OnnxNet::printEnvInfo() noexcept
{
printf("----------------- Build -----------------\n");
#if ORT_API_VERSION <= 14
printf("version: 1.%d (< 1.15.0)\n", ORT_API_VERSION);
#else
printf("version: %s\n", Ort::GetVersionString().c_str());
#endif
auto providers = Ort::GetAvailableProviders();
printf("\n--------------- Providers ---------------\n");
for (std::size_t i = 0; i < providers.size(); i++)
Expand Down

0 comments on commit 50b16f4

Please sign in to comment.