This line works fine
self.conv = nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1, bias=False)
I introduced ResNet18
self.conv
The problem is that resnet18 (and most other classification netwroks) are not fully convolutional networks. The last layer of the net is actually a nn.Linear layer and therefore you cannot simply replace a convolutional block/layer with a resnet.
nn.Linear