Transfer Learning: How to modify the first conv2d layer of Alexnet to accomodate for 9 channel input?

I think the easiest way to do this is to create your model by modifying the Alexnet model from Vision so that the first conv layer has 9 channels

Then to copy the weights over you can copy them from the original Alexnet state_dict to the state_dict of your modified model. It should be direct assignment except for the first conv layer.

4 Likes