Neural network Keras AttributeError:&x27;卷积2d';对象没有属性';设置#u输入';

Neural network Keras AttributeError:&x27;卷积2d';对象没有属性';设置#u输入';,neural-network,keras,convolution,Neural Network,Keras,Convolution,一些使用Keras的样式转换示例初始化内容、样式和组合图像,并将它们输入VGG16的第一层。 但是,卷积2D对象似乎不接受set_输入法 input_tensor = K.concatenate([base_image, style_reference_image, combination_image], axis=0) # build the VGG16 network w

一些使用Keras的样式转换示例初始化内容、样式和组合图像,并将它们输入VGG16的第一层。 但是,卷积2D对象似乎不接受set_输入法

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())

set_input
不是设置模型输入的有效方法-它可能导致意外行为。您是否尝试过函数API?
set\u input
不是设置模型输入的有效方法-它可能会导致意外行为。你试过函数API吗?