Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于测试图像的大小 #49

Open
nihao-eng opened this issue Mar 3, 2023 · 4 comments
Open

关于测试图像的大小 #49

nihao-eng opened this issue Mar 3, 2023 · 4 comments

Comments

@nihao-eng
Copy link

请问作者预训练的模型对测试图像的大小有要求吗?为何我运行 test.py 时出现以下错误

Traceback (most recent call last):
File "test.py", line 64, in
input_re, batch_list = window_partitionx(input_, win)
File "/home/zzu/xkuo/DeepRFT-main/layers.py", line 247, in window_partitionx
x_r = window_partitions(x[:, :, :h, -window_size:], window_size)
File "/home/zzu/xkuo/DeepRFT-main/layers.py", line 213, in window_partitions
x = x.view(B, C, H // window_size, window_size, W // window_size, window_size)
RuntimeError: shape '[1, 3, 1, 256, 0, 256]' is invalid for input of size 58368

@INVOKERer
Copy link
Owner

INVOKERer commented Mar 3, 2023

可能是我之前的代码有bug,你可以先尝试https://github.com/DeepMed-Lab-ECNU/DeepRFT-AAAI2023/blob/main/basicsr/models/archs/FMIMOUNet_arch.py 中的方法进行测试。

@INVOKERer
Copy link
Owner

我更新了一版layers.py文件,不知道能不能解决这个问题。

@nihao-eng
Copy link
Author

首先非常感谢作者的杰出贡献,问题出在我的测试图像太小了,我将参数 --win_size 设置为32可以运行,但似乎对我的测试图像没有效果。

@INVOKERer
Copy link
Owner

可以试试不设置win_size,因为对于我们的方法,模型的训练和测试尺度要尽可能相似。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants