Skip to content

Commit

Permalink
update onnxruntime version to 1.141.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xmba15 committed Apr 11, 2023
1 parent 814e39b commit 567a7b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
test-production:
runs-on: ubuntu-20.04
container:
image: xmba15/onnx_runtime_cpp:v1.10.0-ubuntu20.04
image: xmba15/onnx_runtime_cpp:v1.14.1-ubuntu20.04

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_latest_cmake.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

readonly CMAKE_VERSION_TO_INSTALL="3.18.0"
readonly CMAKE_VERSION_TO_INSTALL="3.24.0"

function command_exists
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_onnx_runtime.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo -l
sudo apt-get update
sudo apt install -y --no-install-recommends zlib1g-dev

readonly ONNXRUNTIME_VERSION="v1.10.0"
readonly ONNXRUNTIME_VERSION="v1.14.1"
git clone --recursive -b ${ONNXRUNTIME_VERSION} https://github.com/Microsoft/onnxruntime
cd onnxruntime

Expand Down
9 changes: 9 additions & 0 deletions src/OrtSessionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*
*/

#include <onnxruntime/core/session/onnxruntime_c_api.h>
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>

#if ENABLE_TENSORRT
Expand Down Expand Up @@ -254,9 +255,13 @@ void OrtSessionHandler::OrtSessionHandlerIml::initModelInfo()
m_inputTensorSizes.emplace_back(
std::accumulate(std::begin(curInputShape), std::end(curInputShape), 1, std::multiplies<int64_t>()));

#if ORT_API_VERSION > 12
m_inputNodeNames.emplace_back(strdup(m_session.GetInputNameAllocated(i, m_ortAllocator).get()));
#else
char* inputName = m_session.GetInputName(i, m_ortAllocator);
m_inputNodeNames.emplace_back(strdup(inputName));
m_ortAllocator.Free(inputName);
#endif
}

{
Expand All @@ -276,9 +281,13 @@ void OrtSessionHandler::OrtSessionHandlerIml::initModelInfo()

m_outputShapes.emplace_back(tensorInfo.GetShape());

#if ORT_API_VERSION > 12
m_outputNodeNames.emplace_back(strdup(m_session.GetOutputNameAllocated(i, m_ortAllocator).get()));
#else
char* outputName = m_session.GetOutputName(i, m_ortAllocator);
m_outputNodeNames.emplace_back(strdup(outputName));
m_ortAllocator.Free(outputName);
#endif
}

{
Expand Down

0 comments on commit 567a7b9

Please sign in to comment.