<p>Almost, there are a few differences however. According to the paper <a href="https://arxiv.org/abs/1512.03385" rel="nofollow noreferrer">https://arxiv.org/abs/1512.03385</a>, resnet50's conv1 layer (as you would find in <code>torchvision.models.resnet50()</code>) has</p>
<p><code>conv1 = {Conv2d} Conv2d(3, 64, kernel_size=(7,7), stride=(2,2), padding=(3,3), bias=False)</code>.</p>
<p>So the differences are<br/>a) the kernel_size is 7x7 not 3x3<br/>b) padding of 3x3 not 1x1 and<br/>c) the weights from resnet50.conv1 from the pretrained model will be conditioned on the training and not initialized as random normal as the will be for <code>nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1, bias=False)</code></p>
Difference between resNet conv1 and traditional conv2d layer
<p>I am using one layer to extract features from image. The old layer is</p>
<pre><code>self.conv = nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1, bias=False)
</code></pre>
<p>New layer is</p>
<pre><code>resConv = models.resnet50(pretrained=True)
resConv.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1, bias=False)
self.conv = resConv.conv1
</code></pre>
<p>Any performance difference? or both layers are same.</p>