wdhudiekou / UMF-CMGR

[IJCAI2022 Oral] Unsupervised Misaligned Infrared and Visible Image Fusion via Cross-Modality Image Generation and Registration
MIT License
170 stars 18 forks source link

运行test_reg.py出现RuntimeError: The size of tensor a (128) must match the size of tensor b (320) at non-singleton dimension 3 #38

Closed xuexisuanfa closed 1 month ago

xuexisuanfa commented 9 months ago

运行test_reg.py出现RuntimeError: The size of tensor a (128) must match the size of tensor b (320) at non-singleton dimension 3 详细错误信息如下: ===> Starting Testing Traceback (most recent call last): File "E:\UMF-CMGR\UMF-CMGR-main\Test\test_reg.py", line 189, in main(args) File "E:\UMF-CMGR\UMF-CMGR-main\Test\test_reg.py", line 66, in main test(net, test_data_loader, args.dst, device) File "E:\UMF-CMGR\UMF-CMGR-main\Test\test_reg.py", line 86, in test ir_pred, f_warp, flow, int_flow1, int_flow2, disp_pred = net(it, ir) File "D:\Users\Anaconda3\envs\UMF_CMGR\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "E:\UMF-CMGR\UMF-CMGR-main\models\deformable_net.py", line 106, in forward features_swarped, = self.spatial_transform_f(c11, up_int_flow2) # torch.Size([16, 16, 128, 128]) File "D:\Users\Anaconda3\envs\UMF_CMGR\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(input, **kwargs) File "E:\UMF-CMGR\UMF-CMGR-main\models\layers.py", line 124, in forward new_locs = self.grid + flow RuntimeError: The size of tensor a (128) must match the size of tensor b (320) at non-singleton dimension 3

Process finished with exit code 1

请问有高手能帮忙解决这个问题吗?

guifenkuaipao commented 2 months ago

您好请问问题解决了吗,同问

wdhudiekou commented 2 months ago

deformable_net.py的顶部有个shape=[]参数,可以根据输入图像的分辨率自行调节