這篇文章主要介紹Jetson TX2如何安裝tensorflow,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
創(chuàng)新互聯(lián)專注于嵩明企業(yè)網(wǎng)站建設,成都響應式網(wǎng)站建設公司,成都商城網(wǎng)站開發(fā)。嵩明網(wǎng)站建設公司,為嵩明等地區(qū)提供建站服務。全流程定制網(wǎng)站建設,專業(yè)設計,全程項目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務
在Jetson TX2上安裝tensorflow,需要在源碼編譯,至少我看到現(xiàn)在的教程都是在源碼上編譯,編譯的時間會很久.
源碼編譯安裝tensorflow可以參考我另外一個教程,這里主要說一些注意要項.
bazel和tensorflow
bazel 和tensorflow的版本注意不要太高,我這里就是bazel和tensorflow的版本選的太高,導致安裝完出現(xiàn)問題,雖然不知道是不是依賴沒有打完整的緣故,但是在這里還是建議選擇低一些的版本.
我這邊選擇的是bazel-5.4,tensorflow1.3
內(nèi)存空間不足
網(wǎng)上說編譯tensorflow可能會出現(xiàn)內(nèi)存空間不夠用的情況,所以需要做一個交換文件,但是實際上我并沒有碰到,但是還是記錄一下
#Create an 8GB swapfile fallocate -l 8G swapfile #Change permission of the swapfile chmod 600 swapfile #Create swap area mkswap swapfile #Activate the swap area sudo swapon swapfile # deactive the swap are sudo swapoff swapfile #Confirm swap area being used swapon -s
修改tensorflow/stream_executor/cuda/cuda_gpu_executor.cc
在tensorflow/stream_executor/cuda/cuda_gpu_executor.cc中找到static int TryToReadNumaNode(conststring &pci_bus_id,intdevice_ordinal)這個函數(shù),在最開始就添加一下內(nèi)容
LOG(INFO) << "ARM has no NUMA node, hardcoding to return zero"; return 0;
計算能力
在執(zhí)行./configure的時候,如果要用到cuda會讓你填Cuda compute capabilities,記得Jetson TX2的Cuda compute capabilities是6.2
Eigen錯誤
external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:359:55: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:360:55: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstore(py, psub(pcj.pmul(pc,yi),pm.pmul(ps,xi))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:360:55: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:374:56: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstoreu(px, padd(pm.pmul(pc,xi),pcj.pmul(ps,yi))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:374:56: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:375:69: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstoreu(px+PacketSize, padd(pm.pmul(pc,xi1),pcj.pmul(ps,yi1))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:375:69: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:376:56: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstore (py, psub(pcj.pmul(pc,yi),pm.pmul(ps,xi))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:376:56: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:377:69: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstore (py+PacketSize, psub(pcj.pmul(pc,yi1),pm.pmul(ps,xi1))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:377:69: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:385:66: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstoreu(x+peelingEnd, padd(pm.pmul(pc,xi),pcj.pmul(ps,yi))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:385:66: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:386:66: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstore (y+peelingEnd, psub(pcj.pmul(pc,yi),pm.pmul(ps,xi))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:386:66: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:415:53: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstore(px, padd(pm.pmul(pc,xi),pcj.pmul(ps,yi))); ^ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:415:53: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ external/eigen_archive/Eigen/src/Jacobi/Jacobi.h:416:53: error: ‘struct Eigen::internal::conj_helper<__vector(4) __builtin_neon_sf, Eigen::internal::Packet2cf, false, false>’ has no member named ‘pmul’ pstore(py, psub(pcj.pmul(pc,yi),pm.pmul(ps,xi)));
這些錯誤是eigen的arm部分有問題,解決方法: https://github.com/tensorflow/tensorflow/issues/9697
https://github.com/samjabrahams/tensorflow-on-raspberry-pi/issues/101
https://bitbucket.org/eigen/eigen/commits/d781c1de9834/
可以手工修改下,或者去下一個上述對arm修改過的3.3版本的Eigen去替換掉 ~/.cache/bazel/_bazel_ubuntu/5a48b4b8cc5de8b183f660553d84cc0b/external/eigen_archive/Eigen(那一長串的目錄具體看你自己的)下的Eigen文件夾(下載地址: )
手工修改方法是將tensorflow/workspace.bzl文件中的
native.new_http_archive( name = "eigen_archive", urls = [ "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", "https://bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", ], sha256 = "ca7beac153d4059c02c8fc59816c82d54ea47fe58365e8aded4082ded0b820c4", strip_prefix = "eigen-eigen-f3a22f35b044", build_file = str(Label("//third_party:eigen.BUILD")), )
替換成
native.new_http_archive( name = "eigen_archive", urls = [ "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", "https://bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", ], sha256 = "a34b208da6ec18fa8da963369e166e4a368612c14d956dd2f9d7072904675d9b", strip_prefix = "eigen-eigen-d781c1de9834", build_file = str(Label("//third_party:eigen.BUILD")), )
GL頭文件問題
Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/opengl.cpp.o In file included from /home/ubuntu/build/opencv/modules/core/src/opengl.cpp:50:0: /usr/local/cuda/include/cuda_gl_interop.h:64:2: error: #error Please include the appropriate gl headers before including cuda_gl_interop.h #error Please include the appropriate gl headers before including cuda_gl_interop.h ^ make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/opengl.cpp.o] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: *** [all] Error 2
注釋/usr/local/cuda/include/cuda_gl_interop.h
#ifndef GL_VERSION #error Please include the appropriate gl headers before including cuda_gl_interop.h #endif #else
以上是“Jetson TX2如何安裝tensorflow”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關知識,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
文章題目:JetsonTX2如何安裝tensorflow
網(wǎng)址分享:http://aaarwkj.com/article10/igehdo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供ChatGPT、全網(wǎng)營銷推廣、動態(tài)網(wǎng)站、網(wǎng)頁設計公司、外貿(mào)網(wǎng)站建設、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)