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