Tensorflow 是目前比較火的開源神經(jīng)網(wǎng)絡(luò)框架,今天一時興起在自己的電腦上搭建了 Tensorflow+python3.6的環(huán)境,目前Tensorflow已經(jīng)支持python3.6免去了之前降級的煩惱陨舱。
首先安裝Anaconda?Windows版下載地址?很簡單 基本上一路Next就行 唯一需要注意的是盡量在D盤上新建一個文件夾作為安裝路徑如D:\Anaconda之類涌矢,方便將conda添加進system path.這點很重要枚驻,記得一定要勾選。
另外出于眾所周知的原因纫谅,最好在conda添加國內(nèi)鏡像炫贤,方法如下:
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
conda config --set show_channel_urls yes
另外,當(dāng)import Scipy時付秕,可能會遇到:
解決方法:Download the corresponding Microsoft Visual C++ Redistributable Package which should be this one based on your description.
鏈接:http://stackoverflow.com/questions/33600302/installing-scipy-in-python-3-5-on-32-bit-windows-7-machine
安裝Microsoft Visual C++ Redistributable Package后温治,問題解決欣范。下載地址:
https://www.microsoft.com/en-us/download/details.aspx?id=48145
Tensorflow安裝:
打開Anaconda Prompt,創(chuàng)建TensorFlow虛擬環(huán)境
在Prompt中輸入:
>>> conda create -n tensorflow python=3.6
啟動Tensorflow環(huán)境:
>>>activate tensorflow
安裝GPU版的TensorFlow:
pip install tensorflow-gpu
安裝CUP版的TensorFlow:
pip install tensorflow
測試tensorflow是否安裝成功
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> sess.run(hello)
b'Hello, TensorFlow!'
大功告成灯节!