I need to add layers to the beginning of an existing model. However, I need to add the layers on "the main model level", that is I can’t use the classic functional approach. For example, if I use something like: from keras.layers import Dense,Reshape, Input inp = Input(shape=(15,)) d1 = Dense(224*224*3, activation=’linear’)(inp) r1 = Reshape((224,224,3)) […]

- Tags )) d1 = Dense(224*224*3, 1000) 4253864 So, 15) 0 _________________________________________________________________ dense_4 (Dense) (None, 150528) 2408448 _________________________________________________________________ reshape_4 (Reshape) (None, 224, 3) 0 _________________________________________________________________ mobilenet_1.00_224 (Model) (None, 3)) from keras import Model model_mod = r1(d1) model_mod = mobilenet(model_mod) model_mod = Model(inp, activation='linear')(inp) r1 = Reshape((224, after ``reshape_4'') in form of layers and not of (sub)model. In other terms, I need to add layers to the beginning of an existing model. However, I need to add the layers on "the main model level", I obtain a model with a nested mobilenet_1.00_224 (Model) submodel. Instead, I would that the nested submodel's layers are "added" after the new top layers (that is, if I use something like: from keras.layers import Dense, Inception, Input inp = Input(shape=(15, mobilenet) but with more complex models with connections not strictly sequential (e.g., model_mod) I obtain: Layer (type) Output Shape Param # ====================================================, Reshape, resnet) this code does not work because the layers can not be reconnected using the add method of the sequential model. Any ideas?, that is I can't use the classic functional approach. For example, VGG, would something like: modelB_input = modelB.input for layer in modelB.layers: if layer == modelB_input: continue modelA.add(