TypeError: 'DType' object is not
2019-08-14 本文已影响0人
一只大南瓜
xs = tf.placeholder(tf.float32([None,1])) #输入属性和输出属性都是1
TypeError: 'DType' object is not callable
错误原因:
在创建placeholder时候需要dtype指定类型
改为:
xs = tf.placeholder(tf.float32, [None, 1])
另外:
placeholder的定义为
def placeholder(dtype, shape=None, name=None):