Tensorflow 错误:AttributeError: enter
一、
代码块:
with tf.Session as sess:
错误:
with tf.Session as sess:
AttributeError: __enter__
错误原因:Session总是忘记写()
二、
代码块:
sess.run(tf.global_variables_initializer)
错误:
TypeError: Fetch argument <function global_variables_initializer at 0x000002116AA07B88> has invalid type <class 'function'>, must be a string or Tensor. (Can not convert a function into a Tensor or Operation.)
错误原因:
tf.global_variables_initialize未写()