0.前言
在Windows 10上安裝好TensorFlow之後,信心慢慢地寫幾行代碼測試一下,可卻遇到了麻煩,只好將Session重新設置一下,才解決了這一問題。
1.測試程序
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 21:42:09 2020
@author: QiuMingZS
"""
import tensorflow as tf
info = tf.constant('Hello, Tensorflow!')
sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True))
print(sess.run(info))