danfenghong / IEEE_TPAMI_SpectralGPT

Hong, D., Zhang, B., Li, X., Li, Y., Li, C., Yao, J., Yokoya, N., Li, H., Ghamisi, P., Jia, X., Plaza, A. and Gamba, P., Benediktsson, J., Chanussot, J. (2024). SpectralGPT: Spectral remote sensing foundation model. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024. DOI:10.1109/TPAMI.2024.3362475.
192 stars 21 forks source link

There are issues with the SegMunich code for downstream tasks #26

Closed cyx-19 closed 2 months ago

cyx-19 commented 2 months ago

In the relevant code of SegMunich, there is a file called train_rulti_GPU_new.cpy, which has a parameter of num classes to determine the number of classes. When the model was just created, num classes were indeed passed in as parameters. The source code is: model=creat_madel (nb_classes=num_classes, weight_path=pretrain_path, pretrain=True), But in fact, model=vit_dase-patch8 (num_classes=nb_classes) was called in the creat_madel function. After going deeper layer by layer, the final code is: model=VisionTransformer( img_size=128, in_chans=1, patch_size=8, embed_dim=768, depth=12, num_heads=12, mlp_ratio=4, num_frames=12, t_patch_size=3, norm_layer=partial(nn. LayerNorm, eps=1e-6), **kwargs, ) Find the location of the model definition. There is a parameter of num_classes=10, which is the num-class we initially passed in. However, in reality, this parameter has not been used, and the model has been written to 13 instead of num-class. The source code is self. cls_sg=nn Sequential( nn.Conv2d(256, 13, kernel_size=3, padding=1), ) The correct answer should be: self. cls_sg=nn Sequential( nn.Conv2d(256, num_classes, kernel_size=3, padding=1), )