Skip to content

Layer norm not working in densenet #7293

Closed
@MiguelMonteiro

Description

@MiguelMonteiro

Describe the bug
Layer norm does not work with densenet, returns the following error when instantiating model:

TypeError: LayerNorm.__init__() missing 1 required positional argument: 'normalized_shape'

To Reproduce

from monai.networks.nets.densenet import densenet121
model = densenet121(spatial_dims=3, in_channels=1, out_channels=2048, norm="layer")

Expected behavior
It should work or not be an option.

Environment

Python 3.10, pytorch 2.0.1, monai 1.3.0

Additional context
Bug has previously been reported here Project-MONAI/research-contributions#196

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