Skip to content

Small ResNets have an extra convolution #10583

Open
@zaccharieramzi

Description

@zaccharieramzi

Prerequisites

Please answer the following question for yourself before submitting an issue.

  • I checked to make sure that this feature has not been requested already.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/official/vision/modeling/backbones/resnet.py

2. Describe the feature you request

The ResNet18 and ResNet34 have an extra convolution compared to what was described in the original paper and to PyTorch.

Indeed, in the first block of the small resnets, the projection should not be used, as there is no increase in dimension.
This can be seen clearly in Figure 3. of the paper where the first shortcut is not dashed.

It would be interesting for reproducibility's sake to have at least the option to remove this extra projection.

3. Additional context

I was actually implementing the ResNet18 and 34 in keras applications and had to remove this first projection too in order to get the same parameter count as PyTorch.

Note that this is different from #3825 which required a mean to have a different projection function.

4. Are you willing to contribute it? (Yes or No)

Yes, submitting a PR ASAP.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions