wgcban / SemiCD

Revisiting Consistency Regularization for Semi-supervised Change Detection in Remote Sensing Images
https://www.wgcban.com/research#h.ar24vwqlm021
120 stars 19 forks source link

inference results are all zeros #9

Closed ggsDing closed 1 year ago

ggsDing commented 1 year ago

Hi. I loaded the pretrained weights and configs for Levir_CD and ran the inference codes.

I got the following output info:

Test Results | PixelAcc: 0.0163, IoU(no-change): 0.0163, IoU(change): 0.0000 |:   9%| | 12/128 [00:0/root/autodl-nas/levir_CD/test/test.txt
Test Results | PixelAcc: 0.0160, IoU(no-change): 0.0160, IoU(change): 0.0000 |:  10%| | 13/128 [00:0/root/autodl-nas/levir_CD/test/test.txt
Test Results | PixelAcc: 0.0149, IoU(no-change): 0.0149, IoU(change): 0.0000 |:  11%| | 14/128 [00:0/root/autodl-nas/levir_CD/test/test.txt
Test Results | PixelAcc: 0.0139, IoU(no-change): 0.0139, IoU(change): 0.0000 |:  12%| | 15/128 [00:0/root/autodl-nas/levir_CD/test/test.txt

I checked the results and found them to be all zeros (black maps). I also checked the output results using:

        #PREDICT
        with torch.no_grad():
            output = multi_scale_predict(model, image_A, image_B, scales, num_classes)
        print(output.shape)
        prediction = np.asarray(np.argmax(output, axis=0), dtype=np.uint8)
        print(prediction.shape)
        print(np.min(prediction))
        print(np.max(prediction))

and confirmed that the output are all zero matixes, which is quite confusing.

wgcban commented 1 year ago

@ggsDing Thanks for letting me know! Please check everything is correctly configured. Especially, check if you specify the parameter values corresponding to the downloaded pre-trained model exactly in the config.

ggsDing commented 1 year ago

@ggsDing Thanks for letting me know! Please check everything is correctly configured. Especially, check if you specify the parameter values corresponding to the downloaded pre-trained model exactly in the config.

Thanks for the reply. I found out that there was a problem in the path config. The tested results are quite competitive.

ggsDing commented 1 year ago

Please check if the trained weights and config files for LevirCD Semi-10% are correct. After loading the files, the generated output path is 'SemiCD_(sup+unsup)10' instead of 'SemiCD(semi)_10'.