欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

基于docker如何安裝tensorflow

這篇“基于docker如何安裝tensorflow”文章的知識點大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“基于docker如何安裝tensorflow”文章吧。

青羊網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)等網(wǎng)站項目制作,到程序開發(fā),運營維護。創(chuàng)新互聯(lián)成立于2013年到現(xiàn)在10年的時間,我們擁有了豐富的建站經(jīng)驗和運維經(jīng)驗,來保證我們的工作的順利進行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)。

安裝docker

docker分為ce和ee,這里我們選擇ce,也就是常規(guī)的社區(qū)版,首先移除本機上可能存在的舊版本。

移除舊版本

$ sudo apt-get remove docker \
  docker-engine \
  docker.io

安裝可選內(nèi)核模塊

從ubuntu14.04以后,某些裁剪后的系統(tǒng)會把一部分內(nèi)核模塊移到可選內(nèi)核包中,常以linux-image-extra-*開頭,而docker推薦的存儲層驅(qū)動aufs包含在可選內(nèi)核模塊包中,所以還是建議安裝可選內(nèi)核模塊包的??梢允褂靡韵旅畎惭b:

$ sudo apt-get update
$ sudo apt-get install \
 linux-image-extra-$(uname -r) \
 linux-image-extra-virtual

證書及密鑰準備

在正式安裝之前,我們需要添加證書以及https傳輸?shù)能浖员WC軟件下載過程中不被篡改:

$ sudo apt-get update
$ sudo apt-get install \
 apt-transport-https \
 ca-certificates \
 curl \
 software-properties-common

添加軟件源的gpg密鑰:

$ curl -fssl https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 官方源
# $ curl -fssl https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

最后添加docker軟件源:

$ sudo add-apt-repository \
 "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
 $(lsb_release -cs) \
 stable"
# 官方源
# $ sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) \
# stable"

安裝docker

$ sudo apt-get update
$ sudo apt-get install docker-ce

建立docker用戶組

docker通常會使用unix socket和docker引擎通訊,通常只有root和docker用戶組的用戶才可以訪問該socket,不然你就要一直sudo,所以最好把你當(dāng)前需要使用docker的用戶添加到docker用戶組中。

建立docker用戶組

$ sudo groupadd docker

將當(dāng)前用戶加入用戶組

$ sudo usermod -ag docker $user

最后重新登錄下系統(tǒng)

測試docker

確保服務(wù)啟動

$ sudo service docker start

使用helloworld測試

測試安裝是否成功

docker run hello-world
unable to find image 'hello-world:latest' locally
latest: pulling from library/hello-world
ca4f61b1923c: pull complete 
digest: sha256:083de497cff944f969d8499ab94f07134c50bcf5e6b9559b27182d3fa80ce3f7
status: downloaded newer image for hello-world:latest

hello from docker!
this message shows that your installation appears to be working correctly.

to generate this message, docker took the following steps:
 1. the docker client contacted the docker daemon.
 2. the docker daemon pulled the "hello-world" image from the docker hub.
 (amd64)
 3. the docker daemon created a new container from that image which runs the
 executable that produces the output you are currently reading.
 4. the docker daemon streamed that output to the docker client, which sent it
 to your terminal.

to try something more ambitious, you can run an ubuntu container with:
 $ docker run -it ubuntu bash

share images, automate workflows, and more with a free docker id:
 https://cloud.docker.com/

for more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

若能顯示,證明安裝成功。

安裝tensorflow

有了docker,安裝tensorflow基本沒有什么難度。

下載鏡像

docker pull tensorflow/tensorflow

基于docker如何安裝tensorflow

下載完畢后顯示:

status: downloaded newer image for tensorflow/tensorflow:latest

創(chuàng)建tensorflow容器

docker run --name my-tensorflow -it -p 8888:8888 -v ~/tensorflow:/test/data tensorflow/tensorflow
  • --name:創(chuàng)建的容器名,即my-tensorflow

  • -it:保留命令行運行

  • p 8888:8888:將本地的8888端口和http://localhost:8888/映射

  • -v ~/tensorflow:/test/data:將本地的~/tensorflow掛載到容器內(nèi)的/test/data下

  • tensorflow/tensorflow :默認是tensorflow/tensorflow:latest,指定使用的鏡像

輸入以上命令后,默認容器就被啟動了,命令行顯示:

[i 15:08:31.949 notebookapp] writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[w 15:08:31.970 notebookapp] warning: the notebook server is listening on all ip addresses and not using encryption. this is not recommended.
[i 15:08:31.975 notebookapp] serving notebooks from local directory: /notebooks
[i 15:08:31.975 notebookapp] 0 active kernels
[i 15:08:31.975 notebookapp] the jupyter notebook is running at:
[i 15:08:31.975 notebookapp] http://[all ip addresses on your system]:8888/?token=649d7cab1734e01db75b6c2b476ea87aa0b24dde56662a27
[i 15:08:31.975 notebookapp] use control-c to stop this server and shut down all kernels (twice to skip confirmation).
[c 15:08:31.975 notebookapp] 
 
 copy/paste this url into your browser when you connect for the first time,
 to login with a token:
  ;
[i 15:09:08.581 notebookapp] 302 get /?token=649d7cab1734e01db75b6c2b476ea87aa0b24dde56662a27 (172.17.0.1) 0.42ms

拷貝帶token的url在瀏覽器打開

http://[all ip addresses on your system]:8888/?token=649d7cab1734e01db75b6c2b476ea87aa0b24dde56662a27

顯示如下:

基于docker如何安裝tensorflow

顯示jupyter notebook,jupyter notebook(此前被稱為 ipython notebook)是一個交互式筆記本。示例中已經(jīng)顯示了tensorflow的入門教程,點開一個可以看見

基于docker如何安裝tensorflow

如上面這個例子,是使用tensorflow來使兩個array相加,我們點擊run,就可以看到運行的結(jié)果了。

關(guān)閉容器

docker stop my-tensortflow

再次打開

docker start my-tensortflow

如果不喜歡用jupyter notebook,我們也可以創(chuàng)建基于命令行的容器

基于命令行的容器

docker run -it --name bash_tensorflow tensorflow/tensorflow /bin/bash

這樣我們就創(chuàng)建了名為bash_tensorflow的容器

還是用start命令啟動容器:

docker start bash_tensorflow

再連接上容器:

docker attach bash_tensorflow

可以看到我們用終端連接上了容器,和操作linux一樣了。

以上就是關(guān)于“基于docker如何安裝tensorflow”這篇文章的內(nèi)容,相信大家都有了一定的了解,希望小編分享的內(nèi)容對大家有幫助,若想了解更多相關(guān)的知識內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

文章標題:基于docker如何安裝tensorflow
標題鏈接:http://aaarwkj.com/article30/jegeso.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google軟件開發(fā)、網(wǎng)站建設(shè)、全網(wǎng)營銷推廣微信小程序、網(wǎng)站排名

廣告

聲明:本網(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)

營銷型網(wǎng)站建設(shè)
久久麻豆精亚洲av品国产一区| 国产在线观看91精品一区| 国产丝袜肉丝在线播放| 日韩一级免费高清黄片| 国产av爆操黑丝美女| 熟女另类视频在线观看| 国产亚洲一区二区三区午夜 | 国产美女作爱视频网站| 水牛av影视亚洲精品| 日韩在线不卡av一区二区| 国语少妇高潮对白在线| 中文岳妇荡欲丰满肥熟| 亚洲精品成人久久国产| 久久精品国产一区二区三区91| 蜜臀av中文字幕在线| 国产日韩欧美一区综合| 亚洲国产av永久精品成人| 国产在线精彩视频自拍| 亚洲欧美精品一中文字幕| 国产黄色一区二区三区四区| 在线观看国产自拍精品| 中文字幕亚洲精品熟女少妇| 日韩欧美国产麻豆91在线精品| 国产偷国产偷亚洲综合av| 国产日本韩国三级在线| 高清中文字幕一区二区三区| 一级片高清在线观看国产| 亚洲欧美国产另类精品| 东京一区二区三区四区黄片| 国产剧情av在线播放| 精品色欧美色国产一区国产| 日韩一级精品电影网| 中文字幕人妻丝袜乱一区二区| 黄色av链接在线观看| 动漫美女视频在线看黄| 操女逼无遮挡国产av| 91精品手机在线观看| 91国内精品手机在线高清| 中文字幕一区二区三天| 婷婷五五月深爱开心激情| 欧美日韩一区二区三区激情|