系統環境確認
- Windows Server 2016
- GeForce GTX 1070 Ti
- Python 3.7
- Visual Studio 2019
安裝步驟
1. 創建並啟用虛擬環境
> conda create -n tensorflow_gpu python=3.7
> conda activate tensorflow_gpu
2. 安裝正確版本的 tensorflow-gpu
> pip install tensorflow-gpu==2.1.0
3. 測試 tensorflow 能否成功連結至 GPU
> python
Python 3.7.7
>>> import tensorflow as tf
>>> tf.compat.v1.disable_eager_execution()
>>> hello = tf.constant('yo')
>>> sess = tf.compat.v1.Session()
![](https://scontent-tpe1-1.xx.fbcdn.net/v/t1.15752-9/106175334_2583855175265039_9222164975870909260_n.png?_nc_cat=101&_nc_sid=b96e70&_nc_oc=AQmj_GrPWadKLMdQDsO3TGixbfzWtwGYNJu-1JXxoYu0gyIMGWROPappAMFoucJfKTY&_nc_ht=scontent-tpe1-1.xx&oh=b0dc81a85a3c65e5553826a9b973106b&oe=5F18F950)