ZhouCX117 / UAED_MuGE

Code for UAED and MuGE
65 stars 7 forks source link

some confusing codes in the file #36

Open senliontec opened 1 month ago

senliontec commented 1 month ago

In sigma_logit_unetpp.py:

line 165 - 170

the code is as following:

    for module in model.modules():
        if isinstance(module, nn.Conv2d) and module.in_channels == default_in_channels:
            break
    weight = module.weight.detach()
    module.in_channels = new_in_channels

I guess the variable 'weight' is in the for loop, please check it and the following codes.

thank you ~

ZhouCX117 commented 1 month ago

The function is used for getting first conv, so it skips the loop when module is nn.Conv2d. You can refer to https://github.com/qubvel-org/segmentation_models.pytorch/blob/main/segmentation_models_pytorch/encoders/_utils.py.