hossein:

Now, my question is, what happens to the weights of the first layer (which I change that).


The weights of the first layer would be the same as the pretrained ResNet50 that you are using as you only changing the input size, assuming that you have not done any finetuning or training with target data.



 hossein:

In addition, what are the initial weights of my last layer (which wasn’t trained in the original one).


Since the last layer is just declared but not trained yet, it would be initialized with a default weight initializer.
https://discuss.pytorch.org/t/how-are-layer-weights-and-biases-initialized-by-default/1307
If its a linear layer check [this] line 57-64.(pytorch/linear.py at master · pytorch/pytorch · GitHub)



 hossein:

Lastly, do the weights of 3 channel model fit properly to a one channel model?


You would benefit from pretrained model if learned weights of all three channels have similar distribution. But you still need to train (most likely) all layers with target data.