Commit 2bab0afc authored by Ting-Shuo Yo's avatar Ting-Shuo Yo

Update README.md

parent d3c5fc29
......@@ -124,19 +124,33 @@ export LIBRARY_PATH=/usr/local/cuda/lib64/:$LIBRARY_PATH
# 3. Install TensorFlow-GPU
## 3.1 Install and Update Python
1. Download the latest Anaconda from the [Anaconda website](https://www.anaconda.com/download/).
`$ wget https://repo.anaconda.com/archive/Anaconda3-5.3.1-Linux-x86_64.sh`
2. Install Anaconda with the downloaded binary.
`$ bash Anaconda3-5.3.1-Linux-x86_64.sh `
3. Downgrade python to 3.6 for compatability:
```
$ conda install python=3.6
$ conda update --all
```
## 3.2 Install tensorflow-gpu
With all packages and libraries installed, this might be the easiest step:
`$ pip install tensorflow-gpu`
## 3.3 Testing
https://www.tensorflow.org/guide/using_gpu
Finally, let's test whether the whole configuration works. According to the [documentation of tensorflow](
https://www.tensorflow.org/guide/using_gpu), we can test whether the GPU works with a few lines of codes.
Logging Device placement
## Logging Device placement
To find out which devices your operations and tensors are assigned to, create the session with log_device_placement configuration option set to True.
```
import tensorflow as tf
# Creates a graph.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
......@@ -145,8 +159,11 @@ c = tf.matmul(a, b)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print(sess.run(c))
```
You should see the following output:
```
Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: Tesla K40c, pci bus
id: 0000:05:00.0
......@@ -155,4 +172,4 @@ a: /job:localhost/replica:0/task:0/device:GPU:0
MatMul: /job:localhost/replica:0/task:0/device:GPU:0
[[ 22. 28.]
[ 49. 64.]]
```
\ No newline at end of file
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment