liangjiandeng / DLPan-Toolbox

DLPan Toolbox for Pansharpening
GNU General Public License v3.0
138 stars 19 forks source link

How to validate the qb? #2

Closed codgodtao closed 2 years ago

codgodtao commented 2 years ago

Hello, I am using your toolbox and there are some bugs in adding validation set during the training process. My modification process is as follows:

  1. Generate the QB dataset through the link and MATLAB code you provided and put it in the correct location image 2.Change the Settings in runpanSharping.py as follows cfg.workflow = [('train', 50), ('val', 1)] cfg.dataset = {'train': 'qb','val': 'qb'} And modify 185 line of trainer.py as eval_loader, eval_sampler = sess.get_test_dataloader(cfg.dataset[mode], distributed) 3.Run, and the val_step function on line 219 of UDL\Basis\python_sub_class.py gives the following error File "01-DL-toolbox(Pytorch)\UDL\Basis\python_sub_class.py", line 219, in val_step result_our = torch.squeeze(sr).permute(1, 2, 0) RuntimeError: number of dims don't match in permute 4.After debugging, it is found that the tensor size of the passed sr is (64,4,64,64). Is it the problem of the data? How to solve this? Looking forward to your reply!
XiaoXiao-Woo commented 2 years ago

cfg.dataset = {'train': 'qb','val': 'qb'} should be cfg.dataset = {'train': 'qb','val': 'TestData_qb'} for evaluate TestData_qb.h5. I will update the comments of add_argument('dataset') to distinguish train/validate/test.

XiaoXiao-Woo commented 2 years ago

I forgot valid_qb_10000.h5. Now, I have fixed it, please check it again, Thank you.