I am trying to change the input shape of ResNet50 network. I Need inputs with more than 3 channels. The ResNet application works when you specify the input shape without loading imagenet weights but I would like to use weights of imagenet to avoid a long training phase.
I am aware that weights of imagenet is for input shape with three channels but theoretically by cutting the head of the network and adding a new input layer this should work.
I tried to remove the head layer but I have some problems saying number of filters is different from 3
ValueError: number of input channels does not match corresponding dimension of filter, 6 != 3
model=keras.applications.resnet50.ResNet50(include_top=False,
input_shape(200,200,3),weights='imagenet')
model.layers.pop(0)
model.layers.pop(0)
model.layers.pop()
X_input = Input((200,200,6), name='input_1')
X = ZeroPadding2D((3, 3), name='conv1_pad')(X_input)
model = Model(inputs=X, outputs=model(X))
model.summary()
I think it is possible to change the number of channels of the input shape and still using weights from imagenet but the method that I tried seems to be wrong.