qubvel / segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.
https://smp.readthedocs.io/
MIT License
9.14k stars 1.63k forks source link

Fix a potential bug in the `patch_first_conv` function #818

Closed i-aki-y closed 6 months ago

i-aki-y commented 9 months ago

The patch_first_conv function looks to have a potential bug in the following for-loop because i can be larger than new_weight.shape[1] (= new_in_channels // module.groups) when groups > 1.

        for i in range(new_in_channels):
            new_weight[:, i] = weight[:, i % default_in_channels]

This may not be a problem with the currently supported models, but I think it would be good to correct this.

github-actions[bot] commented 7 months ago

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

github-actions[bot] commented 6 months ago

This PR was closed because it has been stalled for 15 days with no activity.