Thank you @Kapil_Rana  for your reply,
I changed the code to be as the following



 Qur3an:

        self.conv1 = nn.Conv2d(1, self.inplanes, kernel_size=7, stride=2, padding=3,
                               bias=False) 



but I got the following error:
RuntimeError: Error(s) in loading state_dict for ResNet:
size mismatch for conv1.weight: copying a param with shape torch.Size([64, 3, 7, 7]) from checkpoint, the shape in current model is torch.Size([64, 1, 7, 7]).
I think it is related to torch.utils.model_zoo.load_url from which I downloaded the pretrained resnet18.
how I can solve this error?