import tensorflow as tf
a = tf.Variable(1)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer)
print(sess.run(2))
TypeError: Fetch argument <function global_variables_initializer at 0x000000000AC931E0> has
invalid type <class 'function'>, must be a string or Tensor. (Can not convert a function
into a Tensor or Operation.)
tensorflow 中sess.run不能直接运行普通常量,也就是这里的sess.run(2)