wdhudiekou / UMF-CMGR

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

RuntimeError: The size of tensor a (128) must match the size of tensor b (236) at non-singleton dimension 3 #20

Open Theeye404 opened 1 year ago

Theeye404 commented 1 year ago

你好,我当我运行test_reg.py时报这个错误,然后我去查看了报错位置, File "../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 (236) at non-singleton dimension 3 然后我查看了flow是[1,2,170,236] grid是[1,2,128,128] 我想问下这个问题怎么解决呢?

wdhudiekou commented 1 year ago

你把测试图片resize成256*256就可以了,或者保证你的图像的宽和高能被2^3整除

Theeye404 commented 1 year ago

好的 谢谢~

Theeye404 commented 1 year ago

你好 我把图片resize后还是报同样的错误