我想用来keras.applications.resnet50训练模型。但在我的数据中,它们不仅是图像,还有一些表中的变量项。我看到keras的文档,keras.layers.concatenate可以在我展平图像术语后将两层合并在一起。但keras.applications.resnet50不能连接变量项。如何基于预训练模型对层进行服装化?有我的演示代码打击:import kerasfrom keras.models import Sequential, concatenatefrom keras.layers import Dense, Dropout, Flattenfrom keras.layers import Conv2D, MaxPooling2Dfrom keras.utils import to_categoricalfrom keras.layers import Inputfrom keras.models import Modelfrom keras.applications.resnet50 import ResNet50VariableSize = 16ResNet = ResNet50(include_top=True, weights=None, input_tensor=None, input_shape=(64,64,3), pooling=None, classes=2)ResNet.layers.pop()VariableNet = Input(shape=(VariableSize,))ModelNet = keras.layers.concatenate([ResNet, VariableNet]) ## Error#### And connect output layer before complie
添加回答
举报
0/150
提交
取消