Python 全_层生成AttributeError:';内置函数或方法';对象没有属性';获得u形';
我是TensorFlow的新手,试图通过阅读O'Reillys来了解情况。这里的例子依赖于我降级到的TensorFlow 1.14。我的Python 全_层生成AttributeError:';内置函数或方法';对象没有属性';获得u形';,python,tensorflow,layer,shapes,Python,Tensorflow,Layer,Shapes,我是TensorFlow的新手,试图通过阅读O'Reillys来了解情况。这里的例子依赖于我降级到的TensorFlow 1.14。我的Python版本:['3.6.10(默认值,2020年1月16日09:12:04)[GCC]]]在这里出错 >>> conv2 = conv_layer(conv1_pool, shape=[5, 5, 32, 64]) >>> print(conv2) Tensor("Relu_1:0", shape=(
Python版本:['3.6.10(默认值,2020年1月16日09:12:04)[GCC]]]
在这里出错
>>> conv2 = conv_layer(conv1_pool, shape=[5, 5, 32, 64])
>>> print(conv2)
Tensor("Relu_1:0", shape=(?, 14, 14, 64), dtype=float32)
>>> conv2_flat = tf.reshape(conv2_pool, [-1, 7*7*64])
>>> print(conv2_flat)
Tensor("Reshape_1:0", shape=(?, 3136), dtype=float32)
>>> full_layer(conv2_flat, 1024)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in full_layer
AttributeError: 'builtin_function_or_method' object has no attribute 'get_shape'
>conv2=conv_层(conv1_池,形状=[5,5,32,64])
>>>打印(conv2)
张量(“Relu_1:0”,shape=(?,14,14,64),dtype=float32)
>>>conv2_flat=tf.重塑(conv2_池,[-1,7*7*64])
>>>打印(conv2_平面)
张量(“重塑1:0”,形状=(?,3136),数据类型=浮点32)
>>>全_层(conv2_平面,1024)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“”,第2行,在完整层中
AttributeError:“内置函数”或“方法”对象没有属性“获取形状”
不幸的是,我没有太多的线索。张量conv2\u平面
确实有一些形状(?,3136)
但没有函数get\u形状
将其返回到full\u层
我们非常感谢您的帮助
克里斯