【发布时间】:2023-03-09 02:00:02
【问题描述】:
我想用 Keras 构建一个神经网络,但我遇到了一个错误:
AttributeError: 'NoneType' object has no attribute '_inbound_nodes',这是我的示例代码:
from keras.layers.merge import concatenate
img = Input(shape=(64,64,3))
text_input = Input(shape=(192,))
text_emb = Reshape(target_shape=(1, 1, 256))(Dense(256, activation='relu')(text_input))
tiled_emb = keras.backend.tile(text_emb, (-1, 64, 64, 1))
img_feat = Conv2D(400,4,padding='same')(img)
con = concatenate([tiled_emb,img_feat])
conv4 = Conv2D(512, 1)(con)
flat = Flatten()(conv4)
validity = Dense(1, activation='sigmoid')(flat)
Model([img, text_input], validity)
【问题讨论】:
标签: tensorflow keras