1

I have loaded a resnet model using from keras.applications.resnet50 import ResNet50 and now I want to insert some new layers in the middle of the model.

Removing then Inserting a New Middle Layer in a Keras Model

There is a solution described in the link above, but the ResNet model also has some Add layers in its architecture and this is why I get the following error:

ValueError: A merge layer should be called on a list of inputs.

Is there any clean way I can insert new layers in the middle or should I code the model myself from scratch?

1 Answers1

1

In Resnet there are several blocks composed of shortcut path and main path. The difficulty depends on where and how do you want to add or delete, i.e., modifying a shortpath, modifying a main path, or deleting a path. If you insert new layers between blocks (after Add->Activation layer), it will be much easier. If you want to delete some layer, it will be easier to delete a whole block (between two Add layer).

James Dong
  • 404
  • 3
  • 7