Although the state_dict is modified to show the required 64x9x11x11 tensor, the output of last line (list of named modules) shows no change in conv2d layer. Can someone please help me on what changes do I need to make to make Alexnet work for a 9 channel input? Is there a easier way to do this without accessing private attributes?
Is there a way to remove first layer and initialize it with Conv2d(9, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))
My bad! typo in the post but not in the original code! Reinitialization of conv2d will randomly initialize the weights. Besides, the self.features = nn.Sequential( ... container doesn’t allow to change only the first conv2d layer (please correct me if I’m wrong) while keeping all the weights as they are that it received after the first statement above. Still looking for a clue on how to modify the first layer