国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

【tensorflow學習筆記】(2)linux下安裝tensorflow

2019-11-08 02:39:08
字體:
來源:轉載
供稿:網友


可以使用提供的 Pip, Docker, Virtualenv, Anaconda 或 源碼編譯的方法安裝 TensorFlow.

我是在Ubuntu16的系統下使用pip安裝的,python2.7,安裝的事tensorflow1.0,以下實例演示簡單敘述一下。

首先,Pip安裝

<a href="https://en.wikipedia.org/wiki/Pip_(package_manager)" rel="nofollow" "="">Pip 是一個 Python 的軟件包安裝與管理工具.

python2.7版本

# Ubuntu/linux 64-bit$ sudo apt-get install python-pip python-dev

python3.x版本

# Ubuntu/Linux 64-bit$ sudo apt-get install python-pip3 python-dev

接著,tensorflow安裝

# Ubuntu/Linux 64-bit, CPU only, Python 2.7:$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_gpu-1.0.0-cp27-cp27mu-manylinux1_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 8.0 and CuDNN v5.# For other versions, see "Install from sources" below.$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.0-cp27-cp27mu-manylinux1_x86_64.whl

這一步需要翻墻,否則會報錯

還有一種辦法:

$ sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

或者

$ sudo pip install -i http://pypi.douban.com/simple tensorflow

記者加sudo權限,否則會報錯

最后,測試tensorflow安裝是否成功打開終端

$ python>>> import tensorflow as tf>>> hello = tf.constant('Hello, TensorFlow!')>>> sess = tf.session()>>> PRint sess.run(hello)Hello, TensorFlow!>>> a = tf.constant(10)>>> b = tf.constant(32)>>> print sess.run(a+b)42>>>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 衡南县| 阳泉市| 忻州市| 遵义市| 甘洛县| 昌黎县| 宝山区| 定结县| 兴城市| 抚宁县| 广宗县| 肇源县| 贵溪市| 尚志市| 德阳市| 攀枝花市| 嘉定区| 元阳县| 苏尼特右旗| 五华县| 广宗县| 舒兰市| 阜南县| 永平县| 海南省| 福泉市| 铜梁县| 正阳县| 东山县| 调兵山市| 健康| 合山市| 宁海县| 灵石县| 娄底市| 乌兰县| 乌拉特中旗| 公主岭市| 石门县| 都匀市| 定远县|