用paddlepaddle1.5搭建多输入的cnn网络 在网络结构图里看不到第二个输入
Created by: StarryDing
#定义网络 import paddle.fluid as fluid
def cnn_model(image, mode): print(image) conv1 = fluid.layers.conv2d(input=image, num_filters=32, filter_size=5, stride=2, act='relu') conv2 = fluid.layers.conv2d(input=conv1, num_filters=32, filter_size=5, stride=2) bn0 = fluid.layers.batch_norm(input=conv2,act='relu') conv3 = fluid.layers.conv2d(input=bn0, num_filters=64, filter_size=5, stride=2, act='relu') conv4 = fluid.layers.conv2d(input=conv3, num_filters=64, filter_size=3, stride=2) bn1 = fluid.layers.batch_norm(input=conv4,act='relu') conv5 = fluid.layers.conv2d(input=bn1, num_filters=128, filter_size=3, stride=1, act='relu') conv6 = fluid.layers.conv2d(input=conv5, num_filters=128, filter_size=3, stride=1) bn2 = fluid.layers.batch_norm(input=conv6,act='relu')
fc1 = fluid.layers.fc(input=bn2, size=128, act=None)
drop_fc1 = fluid.layers.dropout(fc1, dropout_prob=0.5)
fc2 = fluid.layers.fc(input=drop_fc1, size=64, act=None)
drop_fc2 = fluid.layers.dropout(fc2, dropout_prob=0.5)
# print(mode)
concat1 = fluid.layers.concat(input=[drop_fc2, mode], axis=1)
# print(concat1)
predict = fluid.layers.fc(input=concat1, size=2)
return predict
多输入的模型应该在这里有第二个输入进去的啊 上面那个模型我可以跑通 可是为啥我查看网络结构的时候发现这里并没有我第二个输入的接口呢 是有什么api我没用上么