Skip to content

Problems with ResNet18 #87

@tjingrant

Description

@tjingrant

Hello, resnet18 referenced in this link: https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v1/resnet18v1.onnx has problems between global average pool op and gemm op. Specifically, according to ONNX spec, the output of global avg pool retains the trailing trivial dimensions.

Output data tensor from pooling across the input tensor. Dimensions will be N x C x 1 x 1

Thus, the output of this operation in the context of resnet18 will be (N, C, 1, 1), whereas gemm expects 2-dimensional input as implied by the ONNX spec:

Compute Y = alpha * A' * B' + beta * C, where input tensor A has shape (M, K) or (K, M), input tensor B has shape (K, N) or (N, K),

Clearly putting gemm right after global average pool does not conform to the spec. Either model or the spec should be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions