Keras AttributeError:' Convolution2D'对象没有属性' set_input'

时间:2017-04-18 15:47:19

标签: neural-network keras convolution

使用Keras的一些样式传输示例初始化内容,样式和组合图像,并将它们提供给VGG16的第一层。 但是,Convolution2D对象似乎不接受set_input方法。

input_tensor = K.concatenate([base_image,
                              style_reference_image,
                              combination_image], axis=0)

# build the VGG16 network with 3 images as input
first_layer = Convolution2D(64, 3, 3, activation='relu', name='conv1_1')
first_layer.set_input(input_tensor, shape)

model = Sequential()
model.add(first_layer)
model.add(Convolution2D(64, 3, 3, activation='relu', name='conv1_2', border_mode='same'))
model.add(pooling_func())

model.add(Convolution2D(128, 3, 3, activation='relu', name='conv2_1', border_mode='same'))
model.add(Convolution2D(128, 3, 3, activation='relu', name='conv2_2', border_mode='same'))
model.add(pooling_func())

0 个答案:

没有答案