一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

tensorflow的Virtualenv安裝方式安裝

 心不留意外塵 2016-03-30

時間:2016-01-22來源:linux網(wǎng)站 作者:simplelovecs 

本文介紹了如何在ubuntu上以virtualenv方式安裝tensorflow?!?/p>


安裝pip和virtualenv: 
# Ubuntu/Linux 64-bit
sudo apt-get install python-pip python-dev python-virtualenv

# Mac OS X
sudo easy_install pip
sudo pip install --upgrade virtualenv


創(chuàng)建 Virtualenv 虛擬環(huán)境:

進(jìn)入你想安裝tensorflow的父目錄下,然后執(zhí)行下面命令建立虛擬環(huán)境: 
virtualenv --system-site-packages tensorflow


激活虛擬環(huán)境并安裝tensorflow:

對于python27,則執(zhí)行如下命令: 
source ./tensorflow/bin/activate  # If using bash
source ./tensorflow/bin/activate.csh  # If using csh
(tensorflow)$  # Your prompt should change

# Ubuntu/Linux 64-bit, CPU only:
pip install --upgrade https://storage./tensorflow/linux/cpu/tensorflow-0.6.0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled:
pip install --upgrade https://storage./tensorflow/linux/gpu/tensorflow-0.6.0-cp27-none-linux_x86_64.whl

# Mac OS X, CPU only:
pip install --upgrade https://storage./tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl


對于python3則執(zhí)行如下命令: 
source ./tensorflow/bin/activate  # If using bash
source ./tensorflow/bin/activate.csh  # If using csh
(tensorflow)$  # Your prompt should change

# Ubuntu/Linux 64-bit, CPU only:
pip install --upgrade https://storage./tensorflow/linux/cpu/tensorflow-0.6.0-cp34-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled:
pip install --upgrade https://storage./tensorflow/linux/gpu/tensorflow-0.6.0-cp34-none-linux_x86_64.whl

# Mac OS X, CPU only:
pip3 install --upgrade https://storage./tensorflow/mac/tensorflow-0.6.0-py3-none-any.whl


測試安裝:

在終端執(zhí)行如下命令進(jìn)入python shell環(huán)境:

python

在python shell環(huán)境中測試:

>>> 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
>>>


如果遇到如下錯誤:
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

那是你的CUDA安裝配置不對:

且添加如下兩行到你的 ~/.bashrc 文件 
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda

如果遇到如下錯誤: 
Python 2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
I tensorflow/stream_executor/dso_loader.cc:93] Couldn't open CUDA library libcublas.so.7.0. LD_LIBRARY_PATH: :/usr/local/cuda/lib64
I tensorflow/stream_executor/cuda/cuda_blas.cc:2188] Unable to load cuBLAS DSO.
I tensorflow/stream_executor/dso_loader.cc:93] Couldn't open CUDA library libcudnn.so.6.5. LD_LIBRARY_PATH: :/usr/local/cuda/lib64
I tensorflow/stream_executor/cuda/cuda_dnn.cc:1382] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:93] Couldn't open CUDA library libcufft.so.7.0. LD_LIBRARY_PATH: :/usr/local/cuda/lib64
I tensorflow/stream_executor/cuda/cuda_fft.cc:343] Unable to load cuFFT DSO.
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcuda.so locally
I tensorflow/stream_executor/dso_loader.cc:93] Couldn't open CUDA library libcurand.so.7.0. LD_LIBRARY_PATH: :/usr/local/cuda/lib64
I tensorflow/stream_executor/cuda/cuda_rng.cc:333] Unable to load cuRAND DSO.

由安裝報錯可知,它使用的是7.0版本,故找不到,而如果你安裝的是7.5版本,則可以執(zhí)行如下命令添加相應(yīng)鏈接: 
sudo ln -s /usr/local/cuda/lib64/libcudart.so.7.5 /usr/local/cuda/lib64/libcudart.so.7.0
sudo ln -s libcublas.so.7.5 libcublas.so.7.0
sudo ln -s libcudnn.so.4.0.4 libcudnn.so.6.5
sudo ln -s libcufft.so libcufft.so.7.0<br>sudo ln -s libcurand.so libcurand.so.7.0


本文永久更新地址:http://www./linux/17545.html

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多

    美女露小粉嫩91精品久久久| 日本欧美在线一区二区三区| 久久热在线视频免费观看| 91日韩欧美国产视频| 国产亚洲精品岁国产微拍精品| 白丝美女被插入视频在线观看| 久热青青草视频在线观看| 日韩国产传媒在线精品| 黑鬼糟蹋少妇资源在线观看| 99久久免费中文字幕| 人妻一区二区三区在线| 亚洲黄片在线免费小视频| 1024你懂的在线视频| 嫩呦国产一区二区三区av| 久久国产精品热爱视频| 久久精品国产在热久久| 天堂热东京热男人天堂| 国产午夜精品美女露脸视频| 性欧美唯美尤物另类视频| 韩日黄片在线免费观看| 老司机精品福利视频在线播放| 日本视频在线观看不卡| 偷拍洗澡一区二区三区| 久久热麻豆国产精品视频| 欧美尤物在线视频91| 欧美整片精品日韩综合| 韩国日本欧美国产三级| 国产综合欧美日韩在线精品 | 婷婷色国产精品视频一区| 深夜视频成人在线观看| 九九热精品视频在线观看| 激情内射亚洲一区二区三区| 国产日本欧美韩国在线| 亚洲一区二区久久观看| 亚洲国产精品久久精品成人| 亚洲欧美中文字幕精品| 久久99青青精品免费观看| 精品伊人久久大香线蕉综合| 欧美日韩国产的另类视频| 亚洲精品伦理熟女国产一区二区| 国产亚洲成av人在线观看|