【技術分享】tensorflow-gpu 安裝紀錄 (Windows Server 2016)

系統環境確認 Windows Server 2016 GeForce GTX 1070 Ti Python 3.7 Visual Studio 2019 安裝步驟 1. 創建並啟用虛擬環境 2. 安裝正確版本的 tensorflow-gpu 3. 測試 tensorflow 能否成功連結至 GPU

AI Academy 編輯部2020年06月24日

系統環境確認

  • 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()