UMF-CMGR icon indicating copy to clipboard operation
UMF-CMGR copied to clipboard

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

Open Theeye404 opened this issue 2 years ago • 5 comments

你好,我当我运行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] 我想问下这个问题怎么解决呢?

Theeye404 avatar Dec 23 '22 12:12 Theeye404

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

wdhudiekou avatar Dec 23 '22 14:12 wdhudiekou

好的 谢谢~

Theeye404 avatar Dec 26 '22 11:12 Theeye404

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

Theeye404 avatar Dec 26 '22 11:12 Theeye404

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

请问解决了吗?

llyyccccc avatar Sep 04 '24 14:09 llyyccccc