Linux 下 MNN編譯 | 安裝 | 測試

      網(wǎng)友投稿 1378 2025-04-01

      文章目錄

      文檔學(xué)習(xí)

      首先安裝 protobuf (手動源碼安裝)

      MNN 正確編譯和安裝

      Demo 2.1 姿態(tài)檢測 ( TF 模型轉(zhuǎn)換 MNN 測試 )

      文檔學(xué)習(xí)

      系統(tǒng)環(huán)境: Ubuntu 18.04.5

      MNN快速了解

      中文文檔 – https://www.yuque.com/mnn/cn/cvrt_linux_mac

      首先安裝 protobuf (手動源碼安裝)

      git clone https://github.com/google/protobuf.git cd protobuf git submodule update --init --recursive ./autogen.sh ./configure 或者 指定 安裝目錄 (個人用戶要指定到 /home/當前用戶名/usr/local/ 不然下方可能會報錯) ./configure --prefix=/home/moli/usr/local/ make make check make install ldconfig # refresh shared library cache.

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      15

      16

      17

      18

      git submodule update --init --recursive 執(zhí)行,可能遇到 benchmark.git 和 googletest.git 下載失敗;

      我的方法是手動下載這兩個 git 庫 然后 復(fù)制到 protobuf/third_party 進行解壓

      git submodule update --init --recursive # 報錯如下 Cloning into 'third_party/benchmark'... error: RPC failed; result=52, HTTP code = 0 fatal: The remote end hung up unexpectedly Clone of 'https://github.com/google/benchmark.git' into submodule path 'third_party/benchmark' failed

      1

      2

      3

      4

      5

      6

      7

      8

      ./autogen.sh 執(zhí)行遇到報錯

      ./autogen.sh # 報錯如下 + mkdir -p third_party/googletest/m4 + autoreconf -f -i -Wall,no-obsolete ./autogen.sh: 37: ./autogen.sh: autoreconf: not found

      1

      2

      3

      4

      5

      6

      7

      解決方法為

      sudo apt-get install cmake-curses-gui sudo apt-get install autoconf automake libtool

      1

      2

      3

      4

      普通用戶 make install 執(zhí)行遇到報錯

      root 權(quán)限用戶應(yīng)該不會遇到這個問題

      libtool: error: error: cannot install 'libprotoc.la' to a directory not ending in /usr/local/lib

      1

      解決方法:個人用戶則指定安裝到 當前用戶 usr/local/ 目錄 下,例如

      ./configure --prefix=/home/moli/usr/local/

      1

      MNN 正確編譯和安裝

      git clone https://github.com/alibaba/MNN.git cd MNN cd schema && ./generate.sh cd .. mkdir build && cd build cmake -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=true .. make -j32 # 安裝完成, 查看 版本 ./MNNConvert --version 0.2.1.5git

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      15

      Protobuf 如果沒有安裝可能會遇到如下報錯:

      CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) Call Stack (most recent call first): .. tools/converter/CMakeLists.txt:14 (find_package) -- Configuring incomplete, errors occurred!

      1

      2

      3

      4

      5

      6

      7

      8

      9

      Linux 下 MNN編譯 | 安裝 | 測試

      Ubuntu 解決方法(似乎還是上面的手動源碼安裝能夠根本解決)

      sudo apt-get install libprotobuf-dev protobuf-compiler protoc --version # 輸出如下 libprotoc 3.0.0

      1

      2

      3

      4

      5

      6

      Demo 2.1 姿態(tài)檢測 ( TF 模型轉(zhuǎn)換 MNN 測試 )

      測試主頁 :https://www.yuque.com/mnn/cn/demo_project

      我的轉(zhuǎn)換命令如下( MNN/build 目錄下 ):

      ./MNNConvert -f TF --modelFile ../../changeModel/model-mobilenet_v1_075.pb --MNNModel mobilenet.mnn --bizCode biz # 輸出如下: MNNConverter Version: 0.2.1.5git - MNN @ 2018 Start to Convert Other Model Format To MNN Model... Start to Optimize the MNN Net... Converted Done!

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      選擇圖片進行測試

      選取一張人像圖像 test.png 安放在 MNN/build/test 目錄下

      執(zhí)行命令如下:

      ./multiPose.out mobilenet.mnn test/test.png pose.png

      1

      效果如下

      恭喜你已經(jīng)讀到文末啦,多謝你的鼓勵!

      Git linux

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      上一篇:SecureCRT使用
      下一篇:如何在Excel中創(chuàng)建工作表名稱的動態(tài)列表?
      相關(guān)文章
      亚洲成a人片77777kkkk| 天堂亚洲免费视频| 国产精品亚洲专区在线观看 | 亚洲精品一级无码鲁丝片| 激情五月亚洲色图| 亚洲欧洲日产国码久在线观看| 亚洲a∨国产av综合av下载| 亚洲人6666成人观看| 亚洲AV午夜成人影院老师机影院 | 亚洲精品资源在线| 亚洲乱码中文字幕综合| 久99精品视频在线观看婷亚洲片国产一区一级在线 | 亚洲欧洲日韩国产| 久久久久亚洲精品无码系列| 亚洲夜夜欢A∨一区二区三区| 亚洲成a人片在线观看老师| 亚洲国产欧美日韩精品一区二区三区 | 久久精品国产亚洲综合色| 久久亚洲2019中文字幕| 亚洲日韩中文字幕日韩在线| 亚洲精品伦理熟女国产一区二区| 国产成人亚洲精品| 亚洲婷婷第一狠人综合精品| 亚洲精品成人久久| 亚洲国产美女福利直播秀一区二区| 午夜亚洲av永久无码精品| 亚洲伊人久久综合影院| 国产aⅴ无码专区亚洲av麻豆 | 亚洲欧洲日产国码高潮αv| 国产亚洲精aa成人网站| 亚洲国产精品一区二区第一页| 亚洲2022国产成人精品无码区 | 亚洲国产成人五月综合网| 亚洲色图综合在线| 亚洲精品无码专区久久久| 无码乱人伦一区二区亚洲| 亚洲欧洲日产国码在线观看| wwwxxx亚洲| 国产成人亚洲综合无| 亚洲综合另类小说色区| 久久久综合亚洲色一区二区三区|