ubuntu 16.04 安装TensorFlow GPU版本
推薦新版安裝教程
http://blog.csdn.net/chenhaifeng2016/article/details/78874883
在ubuntu 16.04上安裝cuda8.0和cudnn ?5.1,請參考以下內容?
http://blog.csdn.net/chenhaifeng2016/article/details/68957732
安裝TensorFlow
sudo apt-get install libcupti-dev
sudo apt-get install python-pip python-dev python-virtualenv
virtualenv --system-site-packages ~/tensorflow
source ~/tensorflow/bin/activate
pip install --upgrade tensorflow-gpu
測試TensorFlow
通過Pycharm創建測試工程
運行效果
/home/chenhf/tensorflow/bin/python /home/chenhf/PycharmProjects/TensowflowTest/MnistDemo.py
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:126] Couldn't open CUDA library libcudnn.so.5. LD_LIBRARY_PATH: /home/chenhf/pycharm-2017.1/bin:/usr/local/cuda-8.0/lib64:
I tensorflow/stream_executor/cuda/cuda_dnn.cc:3517] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
Extracting MNIST_data/train-images-idx3-ubyte.gz
Extracting MNIST_data/train-labels-idx1-ubyte.gz
Extracting MNIST_data/t10k-images-idx3-ubyte.gz
Extracting MNIST_data/t10k-labels-idx1-ubyte.gz
((55000, 784), (55000, 10))
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
((10000, 784), (10000, 10))
((5000, 784), (5000, 10))
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:?
name: GeForce GTX 765M
major: 3 minor: 0 memoryClockRate (GHz) 0.8625
pciBusID 0000:01:00.0
Total memory: 1.95GiB
Free memory: 1.93GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0?
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: ? Y?
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 765M, pci bus id: 0000:01:00.0)
0.9162
Process finished with exit code 0
準確率在91.6%
--結束--
總結
以上是生活随笔為你收集整理的ubuntu 16.04 安装TensorFlow GPU版本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TensorFlow MNIST CNN
- 下一篇: Android使用Retrofit2.0