import torch
from torchvision.models import resnet18
net = resnet18(pretrained=False) # You should put 'True' here 
net.conv1 = torch.nn.Conv1d(1, 64, (7, 7), (2, 2), (3, 3), bias=False)
batch = torch.rand(4, 1, 224, 224) # in the NCHW format
net(batch).size()