日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

英伟达jetson tx1开发套件配置tensorflow

發布時間:2025/3/15 编程问答 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 英伟达jetson tx1开发套件配置tensorflow 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

英偉達jetson tx1開發套件配置tensorflow

本文為原創作品,未經本人同意,禁止轉載,禁止用于商業用途!本人對博客擁有最終解釋權

歡迎關注我的博客:http://blog.csdn.net/hit2015springhttp://www.cnblogs.com/xujianqing/

?

Jetson tx1本身具有的內存和存儲容量是比較小的,而且它是基于ARM架構的cpu更是與intel的處理器架構不一樣,所以很多網上的分享不適用于TX1的配置。這里從英偉達的jetson hacks上面的官方教程來配置tensorflow。

參考文章:Jetson hacks

http://www.jetsonhacks.com/2016/12/30/tensorflow-nvidia-jetson-tx1-development-kit/

http://www.jetsonhacks.com/2017/01/28/install-samsung-ssd-on-nvidia-jetson-tx1/

http://www.jetsonhacks.com/2016/12/21/jetson-tx1-swap-file-and-development-preparation/

這里分成三步執行

配置外置SSD

這里用的是三星 EVO 250G的SSD,支持SATA接口,ssd插上去開機是不能用的,TX1是沒有識別的,需要的格式化為linux支持的文件系統ext4.一系列配置之后可以把ssd設置為外置的存儲,然后再把文件系統拷貝到SSD中,設置為從SSD啟動系統。和PC機從BIOS啟動不一樣的是,TX1可以用好幾種方式啟動它。只要配置exlinux.conf就OK了。仔細看視頻就可以配置好

  • 斷電,插ssd,上電
  • 通過gui界面來設置,搜索DISKS,如圖

    ?

  • 格式化新建一個分區

    ?

  • ?

    ?

    新建:

    name輸入名字jetsonssd-256

    Ok完成。

    這里新建分區的時候是要輸入盤的大小,輸入250G,這個三星的ssd不能全部新建。

    配置swapfile

    這一步配置交換空間,TX1的內存只有4G,用來配置tensorflow是不夠用的,在配置tensorflow之前要給它加一個交換空間,這個空間的功能是當物理內存不夠時,將某些內存當中所占的程序暫時移動到swap當中,讓物理內存可以被需要的程序來使用。另外,如果你的主機支持電源管理模式,也就是說,你的linux主機系統可以進入休眠狀態的話,娜美運行當中的程序狀態則會被記錄到swap當中去,以作為喚醒主機狀態的依據。

    命令行:


    git clone https://github.com/jetsonhacks/postFlashTX1.git cd postFlashTX1\ ls $ sudo ./createSwapfile.sh -d [directory location] -s[size in gigabytes] –a

    [directory location]:這里填寫你的ssd路徑地址

    [size in gigabytes]:這里填寫你要設置的swap的大小,以G為單位。

    -a:是默認開機自啟動swap,在/etc/fstab中自己設置

    我設置了20G,默認是8G,一般的swap設置為內存的兩倍。

    ?

    下面這段話是該文章里頭提到的一點問題,這里我們用不到,但是可以幫助以后找問題。

    在SSD或其他閃存類型內存上設置交換文件可能會導致設備磨損。大多數當前閃存具有可以執行的讀取和寫入的生存期數量,繁忙的交換文件可以消耗大量的那些。請注意,硬盤驅動器也是如此。較新的SSD已經建立了幫助分發"寫磨損"的機制。一如往常,備份您的驅動器,并將其存儲。在視頻中,交換文件在計算機引導時自動安裝。這是偉大的開發,但之后,你可能要禁用該功能。為此:

    $ sudo gedit / etc / fstab

    并注釋掉執行"swapon"的行。確保保存文件,重新啟動并檢查以確保交換已關閉。

    此外,你可能想要有一個更硬的核心關于你的交換區。您可以留出"交換分區",并使用它而不是交換文件。這種方法可能更快,因為交換區域連續放置。此路由類似于設置交換文件,但超出了本文的范圍。

    運行完后開始在disks里頭設置

    按照圖中正確選擇

    然后重啟系統。

    設置從SSD啟動系統:

    開發板自帶的emmc存儲只有16G,第一步安裝系統后只有4.4G,本次搭建tensorflow環境需要很多存儲,所以需要擴展存儲,但是不能就單單加個SSD就可以,這樣把文件放在SSD是不好用的,需要將系統運行在SSD上才行,按視頻教程后半部分將系統文件復制到SSD中,修改啟動配置文件,使之從SSD內啟動:


    $ sudo cp -ax / '/media/ubuntu/jetsonssd'


    修改配置文件

    The last setup step is to modify the file extlinux.conf file on the eMMC. The system will boot from the internal eMMC, then the kernel will set the root directory to point to the SATA drive


    $ cd /boot/extlinux $ sudo cp extlinux.conf extlinux.conf.original $ sudo gedit /boot/extlinux/extlinux.conf


    這里主要修改幾個地方

    ?

    ?

    ?

    其實整個文件如下:

    TIMEOUT 30
    DEFAULT satassd

    MENU TITLE p2371-2180 eMMC boot options

    LABEL satassd
    MENU LABEL primary SATA SSD
    LINUX /boot/Image
    INITRD /boot/initrd
    FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
    APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0root=/dev/sda1 rw rootwait

    LABEL emmc
    MENU LABEL Internal eMMC
    LINUX /boot/Image
    INITRD /boot/initrd
    FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
    APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait

    標紅的地方是修改的

    重啟ok

    如果要從emmc啟動,則改一下這里的配置就OK了。Label那個位置該一下。

    配置tensorflow

    配置tensorflow真是一個巨坑,歸功于我們牛逼的墻,導致我翻墻失敗,下載安裝依賴項的時候數據包下載不完整,配置不成功,還找不到問題的關鍵。

    然后就開始在github里面看配置的源碼,一個一個找問題。這里就給出他們的源碼,和解析!

    其實這個配置就是一段命令行的配置:

    上github把英偉達的配置demo下載下來:

    git clone https://github.com/jetsonhacks/installTensorFlowTX1 cd installTensorFlowTX1


    配置動態鏈接庫的路徑

    ./setLocalLib.sh

    下載一些安裝依賴項,包括java protobuf等

    ./installPrerequisites.sh

    下載tensorflow源碼


    ./cloneTensorFlow.sh ./setTensorFlowEV.sh

    兩個選擇 n,y

    ./buildTensorFlow.sh ./packageTensorFlow.sh

    這一步要超級權限

    sudo pip install $HOME/tensorflow-0.11.0-py2-none-any.whl cd $HOME/tensorflow time python tensorflow/models/image/mnist/convolutional.py


    這是github里面的文檔說明:

    最少要8g的內存,然后存儲大小最少要5.5g的大小,所以告訴你要給它配置一個硬盤。當然還要設置好庫路徑,這里面通過setlocallib.sh這個文件來設置。

    這里需要編譯兩個版本的Protobuf,一個(v3.1.0)是用于grpc,一個v3.0.0-beta-2用于bazel,安在:$HOME/lib and $HOME/bin.

    Grpc 0.15.0版本,補丁支持arm架構

    grpc-java v0.15.0 requires > v3.0.0-beta-3 of protobuf. A patch is applied for aarch64.

    Bazel

    Builds version 0.3.2. Includes patches for compiling under aarch64.

    這個版本里頭的補丁支持arm64架構

    ?

    ?

    ?

    ?

    Before installing TensorFlow, a swap file should be created (minimum of 8GB recommended). The Jetson TX1 does not have enough physical memory to compile TensorFlow. Also, if TensorFlow is being compiled on the built-in 16GB flash drive, a standard JetPack installation may consume too much room on the drive to successfully build TensorFlow. Extraneous files will need to be removed. Eliminating the .deb files in the home directory appears to be enough to allow TensorFlow to build. Successful builds tend to have more than 5.5GB free. Also, for a successful build it is recommended to set local lib using the included script setLocalLib.sh, as grpc-java in particular seems to run into issues if it /usr/local/lib is not in the path.

    Note: Most of this procedure was derived from the thread: https://github.com/tensorflow/tensorflow/issues/851

    TensorFlow should be built in the following order:

    installPrerequisites.sh

    Installs Java and other dependencies needed. Also builds:

    Protobuf

    Two versions of protobuf are compiled. The first (v3.1.0) is needed to build grpc-java. This version ends up being installed in $HOME/lib and $HOME/bin. The second version (v3.0.0-beta-2) is used to build bazel

    grpc-java

    grpc-java v0.15.0 requires > v3.0.0-beta-3 of protobuf. A patch is applied for aarch64.

    Bazel

    Builds version 0.3.2. Includes patches for compiling under aarch64.

    cloneTensorFlow.sh

    Git clones r0.11 from the TensorFlow repository and patches the source code for aarch64

    setTensorFlowEV.sh

    Sets up the TensorFlow environment variables. This script will ask for the default python library path.

    buildTensorFlow.sh

    Builds TensorFlow.

    packageTensorFlow.sh

    Once TensorFlow has finished building, this script may be used to create a 'wheel' file, a package for installing with Python. The wheel file will be in the $HOME directory, tensorflow-0.11.0-py2-none-any.whl

    Install wheel file

    $ pip install $HOME/tensorflow-0.11.0-py2-none-any.whl

    Test

    Run a simple TensorFlow example for the initial sanity check:

    $ cd $HOME/tensorflow

    $ time python tensorflow/models/image/mnist/convolutional.py

    Build Issues

    For various reasons, the build may fail. The 'debug' folder contains a version of the buildTensorFlow.sh script which is more verbose in the way that it describes both what it is doing and errors it encounters. See the debug directory for more details.

    Notes

    As of this writing (Jan 15, 2017) the TensorFlow repository has an issue which does not allow incremental compilation to work correctly. This is due to an issue in the file:

    tensorflow/third_party/gpus/cuda_configure.bzl

    Where the rule:

    cuda_configure = repository_rule( implementation = _cuda_autoconf_impl, local = True, )

    forces Bazel to always rebuild the CUDA configuration, which in turn foobars the incremental build process. The cloneTensorFlow.sh script patches the file to remove the local = True statement. Additionally, buildTensorFlow.sh sets TensorFlow environment variables to reflect the CUDA structure of the Jetson TX1.

    Since v0.11 was published, the location of the zlib library being used has moved. This is also taken into account by the cloneTensorFlow.sh script, which patches the library location.

    ?

    遇到問題

    Unzipping /home/ubuntu/.gradle/wrapper/dists/gradle-2.13-bin/4xsgxlfjcxvrea7akf941nvc7/gradle-2.13-bin.zip to /home/ubuntu/.gradle/wrapper/dists/gradle-2.13-bin/4xsgxlfjcxvrea7akf941nvc7

    Exception in thread "main" java.util.zip.ZipException: error in opening zip file

    at java.util.zip.ZipFile.open(Native Method)

    at java.util.zip.ZipFile.<init>(ZipFile.java:219)

    at java.util.zip.ZipFile.<init>(ZipFile.java:149)

    at java.util.zip.ZipFile.<init>(ZipFile.java:163)

    at org.gradle.wrapper.Install.unzip(Install.java:214)

    at org.gradle.wrapper.Install.access$600(Install.java:27)

    at org.gradle.wrapper.Install$1.call(Install.java:74)

    at org.gradle.wrapper.Install$1.call(Install.java:48)

    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)

    at org.gradle.wrapper.Install.createDist(Install.java:48)

    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)

    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

    ?

    ?

    解決方法:直接進入

    /home/ubuntu/.gradle/wrapper/dists/gradle-2.13-bin/4xsgxlfjcxvrea7akf941nvc7

    這個路徑,把那個壓縮包去掉,然后自己去官網下一個gradle-2.13-bin.zip包,(網絡真坑爹),當然是放在原來的路徑下嘍!

    然后就OK!

    另一個問題:

    ?

    說git下載有問題,RPC failed curl 56 GnuTLS recv error (-9)

    簡單粗暴,卸載git,再重新安裝




    最后給一個很福利的東西 ? ?https://github.com/rwightman/tensorflow/commit/a1cde1d55f76a1d4eb806ba81d7c63fe72466e6d有好東西,一鍵安裝

    ?


    總結

    以上是生活随笔為你收集整理的英伟达jetson tx1开发套件配置tensorflow的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

    主站蜘蛛池模板: 农村老熟妇乱子伦视频 | 夜夜骚网站 | 欧美va天堂| 在哪看毛片 | 91一区二区在线 | 一起草视频在线播放 | 日韩影视一区二区三区 | 午夜极品视频 | 色妹子综合 | 欧美手机在线观看 | 免费av一级| 精品国产va久久久久久久 | 天堂av亚洲av国产av电影 | 一本之道av | 亚洲精品乱码久久久久久自慰 | 成人免费无码大片a毛片 | 国产精品88久久久久久妇女 | 久久精品片 | 加勒比视频在线观看 | 手机在线看a | 国产三级三级在线观看 | 又粗又猛又爽又黄的视频 | 性生交大片免费看狂欲 | 91精品亚洲 | 久久久久成人精品免费播放动漫 | 国产剧情av麻豆香蕉精品 | 日韩不卡av在线 | 国产精品xxx | 一曲二曲三曲在线观看中文字幕动漫 | 黄色欧美网站 | 久久精品成人av | 国产精品一区二区三区免费观看 | 国产99对白在线播放 | 男女视频一区 | 欧美丰满熟妇xxxxx | av手机在线看 | 91色在线播放 | 亚洲天堂伊人网 | 国产主播99 | 久久激情综合 | 亚洲黄色片在线观看 | 欧美性生活一区二区三区 | 50一60岁老妇女毛片 | 成人午夜小视频 | 综合在线视频 | 国产三级全黄裸体 | 一级片免费观看视频 | 亚州精品毛片 | 一级黄色大片免费观看 | 久在线视频| 黑人高潮一区二区三区在线看 | 国产精品va无码一区二区三区 | 欧美性色19p| 日韩免费播放 | 夜夜爽夜夜叫夜夜高潮漏水 | 在线观看不卡av | 男女羞羞无遮挡 | 国产精品自拍亚洲 | 欧美一级爆毛片 | www.色悠悠| 女上男下动态图 | 日本色www| 国产精品毛片va一区二区三区 | 意大利性荡欲xxxxxx | 韩国av免费观看 | 久久久久久国产精品免费免费 | 国产三级av片 | 小视频在线 | www.色就是色.com | 欧美电影一区二区三区 | 欧美成人午夜免费视在线看片 | 亚洲欧美综合另类自拍 | 国产经典自拍 | 黄色免费成人 | 成人激情免费 | 欧美成人一二区 | 欧洲色视频 | 三上悠亚ssⅰn939无码播放 | 波兰性xxxxx极品hd | 成人黄色电影网址 | 欧美99久久精品乱码影视 | 欧美一区二区三区婷婷月色 | 97影院 | 女大学生的家政保姆初体验 | 爱情岛论坛成人 | 亚洲国产一区二区三区四区 | 欧美黄色a级 | 久久免费少妇高潮99精品 | 国内毛片毛片 | 中文成人无字幕乱码精品区 | 黑人性生活视频 | av网站在线播放 | 日韩国产一区二区三区 | 二区三区不卡 | 色校园| 亚洲一区亚洲二区 | 白浆在线播放 | jizz国产精品 | 日韩a级大片 |