Skip to content

Dimension Mismatch Error in models/unet2d.py #17

@HUANGYming

Description

@HUANGYming

Hello OccDepth developers,

I am experiencing a dimension mismatch issue while working with models/unet2d.py.

Here is a brief description of the issue: Dimension mismatch arises when I set the parameter backbone_2d_name="tf_efficientnet_b5_ns". At this point, whether or not the decoder is used, a dimension mismatch error occurs.

I found that the error originated from these few lines of code:
"tf_efficientnet_b5_ns": [3, 32, 40, 64, 176],
self.resize_output_1_1 = nn.Conv2d(3, out_feature, kernel_size=1)
self.resize_output_1_2 = nn.Conv2d(32, out_feature * 2, kernel_size=1)
self.resize_output_1_4 = nn.Conv2d(48, out_feature * 4, kernel_size=1)

After examining the network structure of efficientnet_b5, I found some dimension definition errors in unet2d.py. I have corrected these errors as follows:

"tf_efficientnet_b5_ns": [3, 24, 40, 64, 176]
self.resize_output_1_1 = nn.Conv2d(MODEL_CHANNELS[self.backbone_2d_name][0], out_feature, kernel_size=1) self.resize_output_1_2 = nn.Conv2d(MODEL_CHANNELS[self.backbone_2d_name][1], out_feature * 2, kernel_size=1) self.resize_output_1_4 = nn.Conv2d(MODEL_CHANNELS[self.backbone_2d_name][2], out_feature * 4, kernel_size=1)

If you encounter these problems, I hope it can help you.

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