linklist2 / PIAFusion_pytorch

91 stars 6 forks source link

unable to test #5

Open tom-kh opened 1 year ago

tom-kh commented 1 year ago

thank you for your implementation with pytorch. Can you please explain how to test this model. "python test_fusion_model.py --h5_path 'test_data/MSRS' --save_path 'results/fusion' --fusion_pretrained 'pretrained/fusion_model_epoch_29.pth' " what is the exact path for testing --h5_path 'test_data/MSRS' ?

there is no h5 file for test data.

linklist2 commented 1 year ago

When testing in my project, there is no need to read the h5 file, but put the corresponding image files into test_data/MSRS, as in the example I gave

tom-kh commented 1 year ago

thank you for your quick response.... but after doing the same there are no results .... no detection at all in the fusion folder which is created after running the test

JAWILU commented 1 year ago

There has a question about the test,i put the one-channel png in the TNO ,and coming the question?please

Traceback (most recent call last): File "\PIA\PIAFusion_pytorch-master\PIAFusion_pytorch-master\test_fusion_model.py", line 76, in fused_image = model(vis_y_image, inf_image) File "C:\Users\Liu\anaconda3\envs\imagefusion-rfn-nest-main\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, kwargs) File "\PIA\PIAFusion_pytorch-master\PIAFusion_pytorch-master\models\fusion_model.py", line 85, in forward vi_encoder_out, ir_encoder_out = self.encoder(y_vi_image, ir_image) File "C:\Users\Liu\anaconda3\envs\imagefusion-rfn-nest-main\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "\PIA\PIAFusion_pytorch-master\PIAFusion_pytorch-master\models\fusion_model.py", line 48, in forward vi_out = activate(self.vi_conv1(y_vi_image)) File "C:\Users\Liu\anaconda3\envs\imagefusion-rfn-nest-main\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "C:\Users\Liu\anaconda3\envs\imagefusion-rfn-nest-main\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward return self._conv_forward(input, self.weight, self.bias) File "C:\Users\Liu\anaconda3\envs\imagefusion-rfn-nest-main\lib\site-packages\torch\nn\modules\conv.py", line 460, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [16, 1, 1, 1], expected input[1, 0, 351, 505] to have 1 channels, but got 0 channels instead

sadatamit17 commented 11 months ago

Hello thanks for the pytorch version of the code, but while i am trying to try with test the dataset the, result fusion is always coming black, will you please guide us, why this is happening? image