Windows安裝TensorFlow-Docker Installation of TensorFlow on Windows


TensorFlow是Google開發的進行Deep Learning的包,目前只是支持在Linux和OSX上運行。不過這個秋季或許就有支持Windows的版本出現了,那么對於使用Windows的開發人員呢,想用TensorFlow也不必等到秋季或轉到Linux和OSX系統。在Windows上運行有兩種方式,一種是安裝虛擬機並且安裝Ubuntu系統,在Ubuntu系統上安裝TensorFlow,具體步驟可以在Google官網上找到:https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#pip-installation。另外一種方式是用Docker來安裝。下面我就分享一下我用Docker安裝TensorFlow的經驗。以下采用Chinglish,並非搬運,但也簡單易讀。

One can always install TensorFlow on Ubuntu in a virtual machine if you are using Windows. Alternatively, you can also choose Docker-Installation.

1. Install Docker From:

https://www.docker.com/products/docker-toolbox

I recommend you install Git for Windows and Oracle VM VirtualBox independently, and thus you just need to click "next". Git for windowns can be accessed at https://git-for-windows.github.io/ amd Oracle VirtualBox can be downloaded at: https://www.virtualbox.org/.

 

2. Open Docker Quickstart Terminal

It will run pre-create checks and one may need to enable "Visualization" in BIOS if it is not. Then you will see the cute whale. 

Sometimes, you may need to regenerate certifications, otherwise you will find error information after the virtual machine. It happened to me, to regenerate the certifications you need to type:

$docker-machine regenerate-certs default

To generate a new virtual machine called "vdocker", you can type:

$docker-machine create vdocker -d virtualbox

Now you can check the running virtual machine by typing:

$docker-machine ls

Or in Virtual Box you will see:

If you see the running virtual machine, then you can go to the next step to install TensorFlow

3. Install TensorFlow

Open a cmd, rather than Docker Terminal,

type

>FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd vdocker') DO %i

Then install TensorFlow:

>docker run -it -p 8888:8888 b.gcr.io/tensorflow/tensorflow

4. Open chrome and go to Open chrome and go to http://192.168.99.***:8888/

You need change the IP according to your case. Then you open the Jupyter and try your first deep learning example.

 

It will give you W is about 0.1 and b is about 0.3:

Enjoy TensorFlow and explore more on deep learning on your own!

By 董輝(ECE@德克薩斯大學Austin分校)

原創內容,未經許可,不需轉載!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM