體系架構 cpu 作業系統 arm64 鯤鵬920 UOS1021
<style>#mermaid-svg-36Elo74uY8LZCafz .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-36Elo74uY8LZCafz .label text{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .node rect,#mermaid-svg-36Elo74uY8LZCafz .node circle,#mermaid-svg-36Elo74uY8LZCafz .node ellipse,#mermaid-svg-36Elo74uY8LZCafz .node polygon,#mermaid-svg-36Elo74uY8LZCafz .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-36Elo74uY8LZCafz .node .label{text-align:center;fill:#333}#mermaid-svg-36Elo74uY8LZCafz .node.clickable{cursor:pointer}#mermaid-svg-36Elo74uY8LZCafz .arrowheadPath{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-36Elo74uY8LZCafz .flowchart-link{stroke:#333;fill:none}#mermaid-svg-36Elo74uY8LZCafz .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-36Elo74uY8LZCafz .edgeLabel rect{opacity:0.9}#mermaid-svg-36Elo74uY8LZCafz .edgeLabel span{color:#333}#mermaid-svg-36Elo74uY8LZCafz .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-36Elo74uY8LZCafz .cluster text{fill:#333}#mermaid-svg-36Elo74uY8LZCafz div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-36Elo74uY8LZCafz .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-36Elo74uY8LZCafz text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-36Elo74uY8LZCafz .actor-line{stroke:grey}#mermaid-svg-36Elo74uY8LZCafz .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-36Elo74uY8LZCafz .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-36Elo74uY8LZCafz #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-36Elo74uY8LZCafz .sequenceNumber{fill:#fff}#mermaid-svg-36Elo74uY8LZCafz #sequencenumber{fill:#333}#mermaid-svg-36Elo74uY8LZCafz #crosshead path{fill:#333;stroke:#333}#mermaid-svg-36Elo74uY8LZCafz .messageText{fill:#333;stroke:#333}#mermaid-svg-36Elo74uY8LZCafz .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-36Elo74uY8LZCafz .labelText,#mermaid-svg-36Elo74uY8LZCafz .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-36Elo74uY8LZCafz .loopText,#mermaid-svg-36Elo74uY8LZCafz .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-36Elo74uY8LZCafz .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-36Elo74uY8LZCafz .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-36Elo74uY8LZCafz .noteText,#mermaid-svg-36Elo74uY8LZCafz .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-36Elo74uY8LZCafz .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-36Elo74uY8LZCafz .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-36Elo74uY8LZCafz .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-36Elo74uY8LZCafz .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .section{stroke:none;opacity:0.2}#mermaid-svg-36Elo74uY8LZCafz .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-36Elo74uY8LZCafz .section2{fill:#fff400}#mermaid-svg-36Elo74uY8LZCafz .section1,#mermaid-svg-36Elo74uY8LZCafz .section3{fill:#fff;opacity:0.2}#mermaid-svg-36Elo74uY8LZCafz .sectionTitle0{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .sectionTitle1{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .sectionTitle2{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .sectionTitle3{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-36Elo74uY8LZCafz .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .grid path{stroke-width:0}#mermaid-svg-36Elo74uY8LZCafz .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-36Elo74uY8LZCafz .task{stroke-width:2}#mermaid-svg-36Elo74uY8LZCafz .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .taskText:not([font-size]){font-size:11px}#mermaid-svg-36Elo74uY8LZCafz .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-36Elo74uY8LZCafz .task.clickable{cursor:pointer}#mermaid-svg-36Elo74uY8LZCafz .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-36Elo74uY8LZCafz .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-36Elo74uY8LZCafz .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-36Elo74uY8LZCafz .taskText0,#mermaid-svg-36Elo74uY8LZCafz .taskText1,#mermaid-svg-36Elo74uY8LZCafz .taskText2,#mermaid-svg-36Elo74uY8LZCafz .taskText3{fill:#fff}#mermaid-svg-36Elo74uY8LZCafz .task0,#mermaid-svg-36Elo74uY8LZCafz .task1,#mermaid-svg-36Elo74uY8LZCafz .task2,#mermaid-svg-36Elo74uY8LZCafz .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-36Elo74uY8LZCafz .taskTextOutside0,#mermaid-svg-36Elo74uY8LZCafz .taskTextOutside2{fill:#000}#mermaid-svg-36Elo74uY8LZCafz .taskTextOutside1,#mermaid-svg-36Elo74uY8LZCafz .taskTextOutside3{fill:#000}#mermaid-svg-36Elo74uY8LZCafz .active0,#mermaid-svg-36Elo74uY8LZCafz .active1,#mermaid-svg-36Elo74uY8LZCafz .active2,#mermaid-svg-36Elo74uY8LZCafz .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-36Elo74uY8LZCafz .activeText0,#mermaid-svg-36Elo74uY8LZCafz .activeText1,#mermaid-svg-36Elo74uY8LZCafz .activeText2,#mermaid-svg-36Elo74uY8LZCafz .activeText3{fill:#000 !important}#mermaid-svg-36Elo74uY8LZCafz .done0,#mermaid-svg-36Elo74uY8LZCafz .done1,#mermaid-svg-36Elo74uY8LZCafz .done2,#mermaid-svg-36Elo74uY8LZCafz .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-36Elo74uY8LZCafz .doneText0,#mermaid-svg-36Elo74uY8LZCafz .doneText1,#mermaid-svg-36Elo74uY8LZCafz .doneText2,#mermaid-svg-36Elo74uY8LZCafz .doneText3{fill:#000 !important}#mermaid-svg-36Elo74uY8LZCafz .crit0,#mermaid-svg-36Elo74uY8LZCafz .crit1,#mermaid-svg-36Elo74uY8LZCafz .crit2,#mermaid-svg-36Elo74uY8LZCafz .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-36Elo74uY8LZCafz .activeCrit0,#mermaid-svg-36Elo74uY8LZCafz .activeCrit1,#mermaid-svg-36Elo74uY8LZCafz .activeCrit2,#mermaid-svg-36Elo74uY8LZCafz .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-36Elo74uY8LZCafz .doneCrit0,#mermaid-svg-36Elo74uY8LZCafz .doneCrit1,#mermaid-svg-36Elo74uY8LZCafz .doneCrit2,#mermaid-svg-36Elo74uY8LZCafz .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-36Elo74uY8LZCafz .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-36Elo74uY8LZCafz .milestoneText{font-style:italic}#mermaid-svg-36Elo74uY8LZCafz .doneCritText0,#mermaid-svg-36Elo74uY8LZCafz .doneCritText1,#mermaid-svg-36Elo74uY8LZCafz .doneCritText2,#mermaid-svg-36Elo74uY8LZCafz .doneCritText3{fill:#000 !important}#mermaid-svg-36Elo74uY8LZCafz .activeCritText0,#mermaid-svg-36Elo74uY8LZCafz .activeCritText1,#mermaid-svg-36Elo74uY8LZCafz .activeCritText2,#mermaid-svg-36Elo74uY8LZCafz .activeCritText3{fill:#000 !important}#mermaid-svg-36Elo74uY8LZCafz .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-36Elo74uY8LZCafz g.classGroup text .title{font-weight:bolder}#mermaid-svg-36Elo74uY8LZCafz g.clickable{cursor:pointer}#mermaid-svg-36Elo74uY8LZCafz g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-36Elo74uY8LZCafz g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-36Elo74uY8LZCafz .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-36Elo74uY8LZCafz .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-36Elo74uY8LZCafz .dashed-line{stroke-dasharray:3}#mermaid-svg-36Elo74uY8LZCafz #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz .commit-id,#mermaid-svg-36Elo74uY8LZCafz .commit-msg,#mermaid-svg-36Elo74uY8LZCafz .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-36Elo74uY8LZCafz g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-36Elo74uY8LZCafz g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-36Elo74uY8LZCafz g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-36Elo74uY8LZCafz g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-36Elo74uY8LZCafz .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-36Elo74uY8LZCafz .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-36Elo74uY8LZCafz .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-36Elo74uY8LZCafz .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-36Elo74uY8LZCafz .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-36Elo74uY8LZCafz .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-36Elo74uY8LZCafz .edgeLabel text{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-36Elo74uY8LZCafz .node circle.state-start{fill:black;stroke:black}#mermaid-svg-36Elo74uY8LZCafz .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-36Elo74uY8LZCafz #statediagram-barbEnd{fill:#9370db}#mermaid-svg-36Elo74uY8LZCafz .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-36Elo74uY8LZCafz .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-36Elo74uY8LZCafz .statediagram-state .divider{stroke:#9370db}#mermaid-svg-36Elo74uY8LZCafz .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-36Elo74uY8LZCafz .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-36Elo74uY8LZCafz .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-36Elo74uY8LZCafz .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-36Elo74uY8LZCafz .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-36Elo74uY8LZCafz .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-36Elo74uY8LZCafz .note-edge{stroke-dasharray:5}#mermaid-svg-36Elo74uY8LZCafz .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-36Elo74uY8LZCafz .error-icon{fill:#522}#mermaid-svg-36Elo74uY8LZCafz .error-text{fill:#522;stroke:#522}#mermaid-svg-36Elo74uY8LZCafz .edge-thickness-normal{stroke-width:2px}#mermaid-svg-36Elo74uY8LZCafz .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-36Elo74uY8LZCafz .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-36Elo74uY8LZCafz .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-36Elo74uY8LZCafz .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-36Elo74uY8LZCafz .marker{fill:#333}#mermaid-svg-36Elo74uY8LZCafz .marker.cross{stroke:#333}
:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}</style>
<style>#mermaid-svg-36Elo74uY8LZCafz {
color: rgba(0, 0, 0, 0.75);
font: ;
}</style>
從原始碼編譯arm架構的bazel
使用編譯好的bazel編譯tensorflow.so
最后會有編譯好的arm架構下的libtensorflow.so.1.15.0和libtensorflow_framework.so.1.15.0下載鏈接(只編譯了CPU版,沒有編譯GPU版)
1、版本確認
1.1 首先確定本次編譯的tensorflow版本:tensorflow-1.15.0
看專案需求,確定使用的tensorflow版本為:1.15.0 下載好tensorflow-1.15.0的原始碼
1.2 其次確定需要的bazel版本:bazel-0.25.0
在tensorflow原始碼內,有configure.py檔案:
打開configure.py檔案,搜索bazel:
可以看到tensorflow-1.15.0版本需要的bazel版本在0.24.1到0.26.1之間,我們選擇bazel-0.25.0的版本,
2、基礎工具下載
2.1 jdk
2.1.1 確定版本
2.1.2 下載安裝:jdk1.8.0_112
2.1.3 jdk環境變數
$ sudo vim /etc/profile # 編輯檔案
# 在最后添加以下三行
export JAVA_HOME= /home/baixin/Desktop/java/jdk1.8.0_112
export PATH= $JAVA_HOME /bin:$PATH
export CLASSPATH= .:$JAVA_HOME /lib/dt.jar:$JAVA_HOME /lib/tools.jar
# 使其生效
$ source /etc/profile
2.2 gcc與g++
gcc: error trying to exec 'cc1plus' : execvp: No such file or directory
2.2.1 確定兩者的版本號
$ gcc -v # 查看gcc版本
$ g++ -v # 查看g++版本
2.2.2 升級降級
參考鏈接
2.3 Nginx
2.3.1 Nginx簡介(具體自行百度)
Nginx (engine x) 是一個高性能的HTTP和反向代理web服務器,效果類似你在瀏覽器輸入:https://linux265.com/static/images/upload/featured-nginx.jpg
2.3.2 為何使用Nginx?
在后面編譯tensorflow時會需要下載很多依賴包,但銳捷客戶端在arm架構下閃退,再加上鯤鵬這批機器沒有無線網卡,下載依賴包會大概率報錯, 其次,bazel在每次編譯時,會清除上次下載的快取,所以直接將下好的檔案放在快取目錄也不可行, 因此,只能使用Nginx在本地搭建檔案服務器,讓bazel從本地下載檔案,
2.3.3 安裝Nginx
$ sudo apt-get update
$ sudo apt-get install nginx
# 添加公匙
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5 3B4FE6ACC0B21F32
# 清除軟體倉庫快取
$ sudo apt-get clean
# 修改軟體源:/etc/apt/source.list檔案
deb http://mirrors.aliyun.com/ubuntu-ports/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial main
deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu-ports/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial universe
deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-security universe
# 重新安裝
$ sudo apt-get update
$ sudo apt-get install nginx
上述參考鏈接:Linux arm64架構修改軟體源
2.3.4 配置
$ sudo find / -name "nginx.conf"
編輯該nginx.conf組態檔(檔案內容大同小異,先找到server模塊,再編輯以下三項):
埠(改大一點,防止默認埠80沖突):7140 字符集:charset UTF-8; 本地檔案要存放的位置:root “/home/baixin/Desktop/file”
# 修改后的部分檔案內容:
.. .. ..
server {
listen 7140; # 設定埠
server_name localhost;
charset UTF-8; # 設定字符集
#access_log logs/host.access.log main;
location / {
root "/home/baixin/Desktop/file" ; # 本地檔案存放位置,根據自己的情況而定
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
.. .. ..
2.3.5 驗證
直接在瀏覽器輸入http://127.0.0.1:7140/img.jpg 即可,(當然,你的/home/baixin/Desktop/file路徑下要有該影像檔案)
3、編譯bazel
3.1 環境(我們之前裝過的就不用裝了)
sudo apt-get install build-essential openjdk-8-jdk python zip unzip
3.2 下載原始碼包
3.3 編譯bazel
env EXTRA_BAZEL_ARGS= "--host_javabase=@local_jdk//:jdk" bash ./compile.sh # 其實這段代碼來自官網
$ cd ./output
$ ./bazel
3.4 配置bazel環境變數
假定編譯好的bazel在/home/baixin/DeskTop/bazel/output目錄下,則在~/.bashrc檔案的末尾添加:
export PATH= /home/baixin/DeskTop/bazel/output:$PATH
$ source ~/.bashrc
4、bazel編譯tensorflow
4.1 正常思路
在tensorflow原始碼目錄下輸入命令,按提示進行相關配置:
$ ./configure
$ bazel build //tensorflow:libtensorflow.so # 我用的這個可以編譯成功,可以多搜些命令,試下,
4.2 但是,,,
編譯程序會下載很多依賴包,而你很大可能下載失敗 報錯會提示你哪個檔案下載失敗,以及該檔案的的URL,根據該URL下好該依賴包,放在標題1.3.2的/home/baixin/Desktop/file目錄下
4.3 如何尋找并修改tensorflow原始碼內的URL?
4.3.1 修改處類似下圖:
其中紅色框內即我們新添加的內容(注意:加入順序也有可能報錯): 參考博客
4.3.2 具體尋找方法
首先,我們要找的檔案都是.bzl后綴,此外原始碼根目錄下WORKSPACE檔案也有可能,
其次,仔細看報錯提示,會告你tensorflow原始碼內的一個檔案,去這個檔案內搜索,看能不能搜到依賴包的URL地址,
最后,根據依賴包名稱,看原始碼的./tensorflow/core與./third_party下有沒有與缺少的依賴同名的檔案夾,進入,尋找后綴是.bzl的檔案,
以上參考:這是一篇非常有用的一篇博客,幫了我很大的忙,當你遇到包下載失敗的時候可以去看這篇文章
5、下載鏈接