Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dimension Mismatch Error in models/unet2d.py #17

Open
HUANGYming opened this issue Nov 14, 2023 · 0 comments
Open

Dimension Mismatch Error in models/unet2d.py #17

HUANGYming opened this issue Nov 14, 2023 · 0 comments

Comments

@HUANGYming
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant