本文主要是介绍Tensorflow 错误一 AttributeError: __enter__,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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未写()
这篇关于Tensorflow 错误一 AttributeError: __enter__的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!