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

upscale 缩放倍数能否为 1? #48

Open
Kang341281X opened this issue Jun 29, 2024 · 8 comments
Open

upscale 缩放倍数能否为 1? #48

Kang341281X opened this issue Jun 29, 2024 · 8 comments

Comments

@Kang341281X
Copy link

您好,我想在 DAT 的基础上做图像去噪任务,但是 DF2K 的高质量和低质量图片存在一定的倍数关系。我想请问一下在训练和测试 DAT 中能否将缩放倍数修改 1?如果可以的话,请问应该如何修改?

@zhengchen1999
Copy link
Owner

可以,调整yml中的scale=1:
https://github.com/zhengchen1999/DAT/blob/main/options/Train/train_DAT_2_x2.yml#L4
https://github.com/zhengchen1999/DAT/blob/main/options/Train/train_DAT_2_x2.yml#L44

但需要重新训练,现有预训练模型只支持特定倍率(x2、x3、x4)

@Kang341281X
Copy link
Author

QQ图片20240701091536
你好,我在调整了上述两个地方的scale=1之后,在训练过程中出现了以上错误。我的训练命令如下:
python -m torch.distributed.launch --nproc_per_node=4 --master_port=4321 basicsr/train.py -opt options/Train/train_DAT_2_x2.yml --launcher pytorch

@zhengchen1999
Copy link
Owner

测试图片有误。按下面的方式:
https://github.com/zhengchen1999/DAT?tab=readme-ov-file#test-images-without-hr

@Kang341281X
Copy link
Author

我现在还没有训练出来模型,上面图片中报错信息是在训练开始时报的错误(调整yml中的scale=1)。是不是高质量和低质量图片的倍数关系就是 yml 中 scale 和 upscale 的值,不可以更改?

@zhengchen1999
Copy link
Owner

需要有特定的训练集,目前的训练集合不支持放大倍数=1,其他设置没有问题。

@Kang341281X
Copy link
Author

感谢您的回答,这也是我比较迷惑的一点。还有一个问题,能不能把低质量图片放大到和高质量图片相同尺寸之后再进行训练?

@zhengchen1999
Copy link
Owner

可以。但是训练集的选择,应该依据你后续测试图片的退化情况。不同数据集训练的模型,适用于不同的退化情况。

@Kang341281X
Copy link
Author

好的,非常感谢您的回答。

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