Tensorflow中出现的错误
出现的错误为
TypeError: Can not convert a function into a Tensor or Operation.
TypeError: Fetch argument <function global_variables_initializer at 0x000001D50A6C5840> has invalid type <class 'function'>, must be a string or Tensor. (Can not convert a function into a Tensor or Operation.)
1
2
错误原因为初始化变量忘记加()
将
init = tf.global_variables_initializer
1
改为
init = tf.global_variables_initializer()
1
即可