Skip to content

Resnet 32x32 in caffe2 generates ResNet with wrong number of layers #33611

Open
@maljoras

Description

@maljoras

Issue description

The generated 32x32 resnet model in caffe2/python/models/resnet.py does not reflect the architecture of He et al (2015). For example, if the num_groups parameter (supposedly n in He et al. 2015) is set to 3, it should generate ResNet18 having 6*n (+ 2) layers. However, it generates a network having 36 (+2) layers (thus ResNet36).

The bug is in line 256 of https://github.com/pytorch/pytorch/blob/master/caffe2/python/models/resnet.py
The line for blockidx in range(0, 2 * num_groups): should be for blockidx in range(0, num_groups): as each simple block already contains 2 conv layers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Resnet 32x32 in caffe2 generates ResNet with wrong number of layers · Issue #33611 · pytorch/pytorch