国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【OnnxRuntime】在linux下編譯并安裝C++版本的onnx-runtime

這篇具有很好參考價值的文章主要介紹了【OnnxRuntime】在linux下編譯并安裝C++版本的onnx-runtime。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

安裝C++接口的onnx-runtime

安裝依賴項:

安裝CMake:可以通過包管理器(如apt、yum等)安裝CMake。

安裝C++編譯器:確保系統(tǒng)中已安裝C++編譯器,如GCC或Clang。

下載源文件

克隆ONNX Runtime的GitHub倉庫,指定版本是為了適配python3.8:

git clone --branch v1.5.2 --recursive https://gitee.com/lee-zq/onnxruntime.git

構(gòu)建ONNX Runtime

進入ONNX Runtime的源代碼目錄:
// 首先創(chuàng)建一個conda環(huán)境,因為./build.sh實際上調(diào)用的是./tools/cl_build/build.py

cd onnxruntime
conda create -n onnxruntime python=3.8
./build.sh --skip_tests --config Release --build_shared_lib --parallel

注意,若配合cuda使用,命令行末尾應(yīng)添加

-cuda_home /usr/local/cuda-11.3 --cudnn_home /usr/local/cuda-11.3

注意,編譯前,確保機器裝有l(wèi)inux環(huán)境:

sudo apt-get install build-essential

這將使用所有可用的CPU核心進行編譯。如果希望使用指定數(shù)量的核心,可以將$(nproc)替換為所需的核心數(shù)量。

安裝ONNX Runtime

運行以下命令進行安裝:

cd /build/Linux/Release
sudo make install

通過按照上述步驟,您應(yīng)該能夠在Linux上成功安裝ONNX Runtime。請注意,安裝過程中可能需要根據(jù)您的系統(tǒng)和需求進行適當(dāng)?shù)恼{(diào)整。

Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/include/onnxruntime/core/common
-- Installing: /usr/local/include/onnxruntime/core/common/code_location.h
-- Installing: /usr/local/include/onnxruntime/core/common/common.h
-- Installing: /usr/local/include/onnxruntime/core/common/const_pointer_container.h
-- Installing: /usr/local/include/onnxruntime/core/common/eigen_common_wrapper.h
-- Installing: /usr/local/include/onnxruntime/core/common/exceptions.h
-- Installing: /usr/local/include/onnxruntime/core/common/logging
-- Installing: /usr/local/include/onnxruntime/core/common/logging/capture.h
-- Installing: /usr/local/include/onnxruntime/core/common/logging/isink.h
-- Installing: /usr/local/include/onnxruntime/core/common/logging/logging.h
-- Installing: /usr/local/include/onnxruntime/core/common/logging/macros.h
-- Installing: /usr/local/include/onnxruntime/core/common/logging/severity.h
-- Installing: /usr/local/include/onnxruntime/core/common/make_unique.h
-- Installing: /usr/local/include/onnxruntime/core/common/optional.h
-- Installing: /usr/local/include/onnxruntime/core/common/status.h
-- Installing: /usr/local/include/onnxruntime/core/graph
-- Installing: /usr/local/include/onnxruntime/core/graph/basic_types.h
-- Installing: /usr/local/include/onnxruntime/core/graph/constants.h
-- Installing: /usr/local/include/onnxruntime/core/graph/function.h
-- Installing: /usr/local/include/onnxruntime/core/graph/graph.h
-- Installing: /usr/local/include/onnxruntime/core/graph/graph_nodes.h
-- Installing: /usr/local/include/onnxruntime/core/graph/graph_viewer.h
-- Installing: /usr/local/include/onnxruntime/core/graph/indexed_sub_graph.h
-- Installing: /usr/local/include/onnxruntime/core/graph/node_arg.h
-- Installing: /usr/local/include/onnxruntime/core/graph/onnx_protobuf.h
-- Installing: /usr/local/include/onnxruntime/core/graph/schema_registry.h
-- Installing: /usr/local/include/onnxruntime/core/framework
-- Installing: /usr/local/include/onnxruntime/core/framework/alloc_kind.h
-- Installing: /usr/local/include/onnxruntime/core/framework/allocator.h
-- Installing: /usr/local/include/onnxruntime/core/framework/customregistry.h
-- Installing: /usr/local/include/onnxruntime/core/framework/data_types.h
-- Installing: /usr/local/include/onnxruntime/core/framework/data_types_internal.h
-- Installing: /usr/local/include/onnxruntime/core/framework/endian.h
-- Installing: /usr/local/include/onnxruntime/core/framework/execution_provider.h
-- Installing: /usr/local/include/onnxruntime/core/framework/fence.h
-- Installing: /usr/local/include/onnxruntime/core/framework/framework_common.h
-- Installing: /usr/local/include/onnxruntime/core/framework/func_api.h
-- Installing: /usr/local/include/onnxruntime/core/framework/kernel_def_builder.h
-- Installing: /usr/local/include/onnxruntime/core/framework/kernel_registry.h
-- Installing: /usr/local/include/onnxruntime/core/framework/ml_value.h
-- Installing: /usr/local/include/onnxruntime/core/framework/op_kernel.h
-- Installing: /usr/local/include/onnxruntime/core/framework/op_kernel_info.h
-- Installing: /usr/local/include/onnxruntime/core/framework/op_node_proto_helper.h
-- Installing: /usr/local/include/onnxruntime/core/framework/ortdevice.h
-- Installing: /usr/local/include/onnxruntime/core/framework/ortmemoryinfo.h
-- Installing: /usr/local/include/onnxruntime/core/framework/run_options.h
-- Installing: /usr/local/include/onnxruntime/core/framework/sparse_tensor.h
-- Installing: /usr/local/include/onnxruntime/core/framework/tensor.h
-- Installing: /usr/local/include/onnxruntime/core/framework/tensor_shape.h
-- Installing: /usr/local/include/onnxruntime/core/providers/cpu
-- Installing: /usr/local/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h
-- Installing: /usr/local/include/onnxruntime/core/optimizer
-- Installing: /usr/local/include/onnxruntime/core/optimizer/graph_transformer.h
-- Installing: /usr/local/include/onnxruntime/core/optimizer/graph_transformer_level.h
-- Installing: /usr/local/include/onnxruntime/core/optimizer/graph_transformer_utils.h
-- Installing: /usr/local/include/onnxruntime/core/optimizer/rewrite_rule.h
-- Installing: /usr/local/include/onnxruntime/core/optimizer/rule_based_graph_transformer.h
-- Installing: /usr/local/include/onnxruntime/core/session
-- Installing: /usr/local/include/onnxruntime/core/session/automl_data_containers.h
-- Installing: /usr/local/include/onnxruntime/core/session/environment.h
-- Installing: /usr/local/include/onnxruntime/core/session/experimental_onnxruntime_cxx_api.h
-- Installing: /usr/local/include/onnxruntime/core/session/experimental_onnxruntime_cxx_inline.h
-- Installing: /usr/local/include/onnxruntime/core/session/onnxruntime_c_api.h
-- Installing: /usr/local/include/onnxruntime/core/session/onnxruntime_cxx_api.h
-- Installing: /usr/local/include/onnxruntime/core/session/onnxruntime_cxx_inline.h
-- Installing: /usr/local/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h
-- Installing: /usr/local/lib/libonnxruntime.so.1.5.2
-- Installing: /usr/local/lib/libonnxruntime.so
-- Installing: /usr/local/bin/onnx_test_runner

安裝完成。文章來源地址http://www.zghlxwxcb.cn/news/detail-718286.html

到了這里,關(guān)于【OnnxRuntime】在linux下編譯并安裝C++版本的onnx-runtime的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • linux下編譯安裝protobuf

    linux下編譯安裝protobuf

    protobuf源碼網(wǎng)址: 在官網(wǎng)上選擇對應(yīng)的版本下載,壓縮包下載可以在線下載之后本地安裝,或者在終端通過wget指令下載 注意:在linux下,可以在home目錄下單獨建一個文件夾,用來保存各種源碼,將編譯好的內(nèi)容放到 /usr/local/ 下面 linux源碼編譯安裝過程一般為配置(configure)、

    2024年02月16日
    瀏覽(29)
  • PG系列4:linux下編譯安裝PG15

    PG系列4:linux下編譯安裝PG15

    PG的編譯安裝比MySQL快很多 –注:請根據(jù)自己的實際情況選擇需要安裝的模塊 編譯時指定wal_compression支持的壓縮外部庫 配置標(biāo)志 –with-lz4 和 –with-zstd 分別用于 lz4 和 zstd。 如果數(shù)據(jù)庫工作負載受 CPU 限制,則可以選擇 Lz4 壓縮,因為它對 CPU 的影響很小。它可以提供非常接近

    2024年02月11日
    瀏覽(17)
  • 【JetsonNano】onnxruntime-gpu 環(huán)境編譯和安裝,支持 Python 和 C++ 開發(fā)

    【JetsonNano】onnxruntime-gpu 環(huán)境編譯和安裝,支持 Python 和 C++ 開發(fā)

    若編譯識別,內(nèi)存不足,可進行擴大交換內(nèi)存 https://labelnet.blog.csdn.net/article/details/136538479 編譯完成標(biāo)識 (1) 整個 build 目錄,包含 build/Linux/Relase https://download.csdn.net/download/LABLENET/88943160 (2) 僅 Python3.8 安裝文件, onnxruntime-gpu-1.16.0-cp38-cp38-linux-aarch64.whl https://download.csdn.net/downloa

    2024年04月15日
    瀏覽(24)
  • ubuntu上安裝boost庫為SOMEIP的X86和ARM下編譯做準備(編譯兩種版本)

    ubuntu上安裝boost庫為SOMEIP的X86和ARM下編譯做準備(編譯兩種版本)

    Boost庫是C++拓展庫,是SOMEIP源碼編譯所必需的庫。編譯 Boost 庫時,需要根據(jù)不同的架構(gòu),選擇不同的工具鏈和參數(shù) 首先,Boost源碼下載,Boost官網(wǎng):https://www.boost.org 基于此處我編譯的SOMEIP源碼版本,需要安裝1.74版本的Boost庫,下載鏈接:https://boostorg.jfrog.io/artifactory/main/relea

    2024年02月10日
    瀏覽(24)
  • 手把手帶你在Linux上安裝帶GPU加速的opencv庫(C++版本)

    手把手帶你在Linux上安裝帶GPU加速的opencv庫(C++版本)

    出現(xiàn)下面類似錯誤 E: unable to locate libjasper-dev ,運行以下命令. 提示沒有 E: unable to locate libjasper-dev 這個包,需要添加數(shù)字簽名: 檢查一下有沒有漏裝依賴(非常重要,否則后續(xù)會失?。?需要出現(xiàn)這面這行提示,說明依賴安裝好了 下載源碼 在opencv文件夾內(nèi)新建build文件夾 編譯

    2024年04月13日
    瀏覽(21)
  • YOLOV8 Onnxruntime Opencv DNN C++部署

    YOLOV8 Onnxruntime Opencv DNN C++部署

    ? ? ? OpenCV由各種不同組件組成。OpenCV源代碼主要由OpenCV core(核心庫)、opencv_contrib和opencv_extra等子倉庫組成。近些年,OpenCV的主倉庫增加了深度學(xué)習(xí)相關(guān)的子倉庫:OpenVINO(即DLDT, Deep Learning Deployment Toolkit)、open_model_zoo,以及標(biāo)注工具CVAT等。 ? ? ? ? OpenCV深度學(xué)習(xí)模塊只

    2024年02月16日
    瀏覽(47)
  • linux下編譯ffmpeg

    ????linux 下編譯ffmpeg,當(dāng)然也可以直接安裝dev,但是不能自動包含cuda等需要的東西,這些東西還是要自己安裝的 下面就詳述編譯過程中的注意點 上面的都要安裝 1 是要安裝cuda,所以先要下載nvcodecheader,安裝nvcodecheader 安裝nvidia-video-codec-sdk,這個是編解碼得核心,一般在

    2024年02月16日
    瀏覽(21)
  • 【嵌入式Qt開發(fā)入門】在Ubuntu下編寫C++

    【嵌入式Qt開發(fā)入門】在Ubuntu下編寫C++

    ????????在 Ubuntu 上面編寫 C++,本文內(nèi)容主要介紹在 Ubuntu 在終端窗口下使用 vi/vim 編輯一 個 C++源文件。通過編寫最簡單的示例“Hello,World!”。帶領(lǐng)大家學(xué)習(xí)如何在 Ubuntu 終端下編輯和編譯 C++。這里要求大家會在 Ubuntu 上使用 vi/vim,也就是要求大家有一點 Ubuntu 入門的基

    2024年02月11日
    瀏覽(23)
  • Linux下編譯LibreOffice在線編輯

    Linux下編譯LibreOffice在線編輯

    LibreOffice本身是沒有在線編輯的功能,如果要編譯LibreOffice在線編輯,需要編譯另外一套源碼CollaboraOnline,CollaboraOnline是基于LibreOffice為核心構(gòu)建的文檔在線編輯,編輯步驟參考以下內(nèi)容: Linux系統(tǒng)版本:Ubantu20.04 CollaboraOnline源碼分支:distro/collabora/co-22-05 打開shell命令窗口,執(zhí)

    2024年02月09日
    瀏覽(20)
  • C++使用onnxruntime/opencv對onnx模型進行推理(附代碼)

    C++使用onnxruntime/opencv對onnx模型進行推理(附代碼)

    結(jié)果: current image classification : French bulldog, possible : 16.17 對兩張圖片同時進行推理 current image classification : French bulldog, possible : 16.17 current image class ification : hare, possible : 8.47 https://download.csdn.net/download/qq_44747572/87810859 https://blog.csdn.net/qq_44747572/article/details/131631153

    2024年02月05日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包