Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

More classes result in smaller model? #861

Closed
fynv opened this issue Mar 13, 2024 · 2 comments
Closed

More classes result in smaller model? #861

fynv opened this issue Mar 13, 2024 · 2 comments
Labels

Comments

@fynv
Copy link

fynv commented Mar 13, 2024

I'm not familiar with the internal structure of the Unet model.
However, I have one assumption, which I think is reasonable, that when I increase the number of output channels, the resulted model should be bigger because there are more trainable paramters.

I have a training dataset with 6 labels and both input and output are 640x480, 3 channels. Each set of labels are stored as 2 rgb images.

I first trained a model with 3 output channels:
model = smp.Unet(
encoder_name="se_resnext50_32x4d",
encoder_weights= "imagenet",
classes=3
)
The .pth file I get is 138,575,607 bytes.

Then I trained:
model = smp.Unet(
encoder_name="se_resnext50_32x4d",
encoder_weights= "imagenet",
classes=6
)
And the .pth file is 138,574,659 bytes, which is slightly smaller than the 3 channel model.

I don't understand why it is happening like this.
(There's nothing strange of the behavior of the models.)

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 13, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

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

No branches or pull requests

1 participant