import tensorflow as tf
x = tf.placeholder(dtype, shape=shape, name=name)
然后出现此错误。
TypeError:'NoneType'对象不可调用
dtype,shape,name
答案 0 :(得分:-1)
这就是你应该如何定义一个安置者
x = tf.placeholder(tf.float32, shape=(1024, 1024))
如果您希望与代码保持一致,则必须初始化代码中使用的变量
>>> import tensorflow as tf
>>> shape=(1024,1024)
>>> dtype=tf.float32
>>> name = "input"
>>> x = tf.placeholder(dtype, shape=shape, name=name)
编辑:这是我运行代码时获得的
>>> import tensorflow as tf
>>> x = tf.placeholder(dtype, shape=shape, name=name)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'dtype' is not defined
>>>