zhengchen1999 / DAT

PyTorch code for our ICCV 2023 paper "Dual Aggregation Transformer for Image Super-Resolution"
Apache License 2.0
386 stars 37 forks source link

Train the Model #27

Open 8596858 opened 8 months ago

8596858 commented 8 months ago

Hello.

How to train the model without the pre-trained model? I want to change some blocks but got some warnings about parameters. I think the problem should be related to pre-trained models

Thank you.

zhengchen1999 commented 8 months ago

For example, set here as pretrain_network_g: ~.

8596858 commented 8 months ago

Thanks a lot!

Quyangya commented 6 months ago

hello When I train the model, I want to replace some modules. Is it on the dat_arch.py interface?

Quyangya commented 6 months ago

我想做一些模块的修改,但是为什么我无论是对dat_arch.py做什么样的修改,哪怕是错的,他都能运行,请问一下是模型加载错了,还是我需要在哪里修改,感觉它加载的都是原来的模型,因为参数量一点都没变,请问一下能给一下解释吗?

zhengchen1999 commented 6 months ago

你是新建的arch文件吗?对模型的名称有修改吗?如果修改了,yml对应也需要修改,位置:https://github.com/zhengchen1999/DAT/blob/main/options/Train/train_DAT_2_x2.yml#L43 另外你可以查看experimetns文件中的log,看看模型结构输出是否和你修改后的模型的一致。

Quyangya commented 6 months ago

我没有新建arch文件,就是用的你的arch文件里面的DAT,只是我增加一些东西,但是我运行的时候并没有运行我修改后的结果,甚至我故意写错,都没有报错,参数一模一样。运行的时候是https://github.com/zhengchen1999/DAT/blob/main/options/Train/train_DAT_2_x2.yml这个吗,因为我运行的是https://github.com/zhengchen1999/DAT/blob/main/options/Train/train_DAT_x2.yml,请指教。运行指令是:python -m torch.distributed.launch --nproc_per_node=4 --master_port=4322 basicsr/train.py -opt options/Train/train_DAT_x2.yml --launcher pytorch,不是只有一个模型的界面吗,我理解的是修改完模型之后,可以运行所有的yml文件,但是此时的模型都应该是我修改的那个,请问我理解的对吗

zhengchen1999 commented 6 months ago

你的理解是对的。所有yml文件都对应同一个模型文件。 PS:我没有遇到过这种情况。一个做法是重新创建一个DAT项目,并且新建环境,这样可以排除python环境的影响。

Quyangya commented 6 months ago

会不会和pip install -r requirements.txt python setup.py develop这两个指令有关,因为我的版本是Python3.9,但是你上面要求是3.8

zhengchen1999 commented 6 months ago

正常没有关系。python的版本不影响程序运行。 但是我觉得你可能没有install成功。

xuxuduoduomeiGithub commented 3 months ago

正常没有关系。python 的版本不影响程序的运行。 但是我觉得你可能没有安装成功。

你好 感谢你的工作,我想尝试复现,但是不知道您的验证集是来源哪里,如何处理的,期待回复~

igotsmoke9 commented 3 months ago

你好 我在尝试 train 的时候 微信图片_20240703143345 bao'le报了这个错误,我是在4块4090上train的 并且没有人占用,是显存不够吗 运行的命令是python -m torch.distributed.launch --nproc_per_node=4 --master_port=4321 basicsr/train.py -opt options/Train/train_DAT_x4.yml --launcher pytorch 希望能得到您的回复