【发布时间】:2017-09-30 07:32:12
【问题描述】:
我想访问Sequential Keras 模型中所有层的层大小。我的代码:
model = Sequential()
model.add(Conv2D(filters=32,
kernel_size=(3,3),
input_shape=(64,64,3)
))
model.add(MaxPooling2D(pool_size=(3,3), strides=(2,2)))
然后我想要一些类似下面的代码工作
for layer in model.layers:
print(layer.get_shape())
.. 但事实并非如此。我得到错误:AttributeError: 'Conv2D' object has no attribute 'get_shape'
【问题讨论】:
标签: python tensorflow deep-learning keras theano