zhengchen1999 / DAT

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

Name DATModel is not found, use name: DATModel_basicsr! #42

Closed KershawTien closed 1 month ago

KershawTien commented 1 month ago

作者您好,按照给出的测试步骤进行python basicsr/test.py -opt options/Test/test_DAT_S_x2.yml这一步时出现了Path already exists. Rename it to C:\Users\lenovo\Desktop\DAT-main\DAT-main\results\test_DAT_S_x2_archived_20240508_164855 2024-05-08 16:48:55,365 INFO: name: test_DAT_S_x2 model_type: DATModel scale: 2 num_gpu: 1 manual_seed: 10 datasets:[ test_1:[ task: SR name: Set5 type: PairedImageDataset dataroot_gt: datasets/benchmark/Set5/HR dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X2 filename_tmpl: {}x2 io_backend:[ type: disk ] phase: test scale: 2 ] test_2:[ task: SR name: Set14 type: PairedImageDataset dataroot_gt: datasets/benchmark/Set14/HR dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X2 filename_tmpl: {}x2 io_backend:[ type: disk ] phase: test scale: 2 ] test_3:[ task: SR name: B100 type: PairedImageDataset dataroot_gt: datasets/benchmark/B100/HR dataroot_lq: datasets/benchmark/B100/LR_bicubic/X2 filename_tmpl: {}x2 io_backend:[ type: disk ] phase: test scale: 2 ] test_4:[ task: SR name: Urban100 type: PairedImageDataset dataroot_gt: datasets/benchmark/Urban100/HR dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X2 filename_tmpl: {}x2 io_backend:[ type: disk ] phase: test scale: 2 ] test_5:[ task: SR name: Manga109 type: PairedImageDataset dataroot_gt: datasets/benchmark/Manga109/HR dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X2 filename_tmpl: {}_LRBI_x2 io_backend:[ type: disk ] phase: test scale: 2 ] ] network_g:[ type: DAT upscale: 2 in_chans: 3 img_size: 64 img_range: 1.0 split_size: [8, 16] depth: [6, 6, 6, 6, 6, 6] embed_dim: 180 num_heads: [6, 6, 6, 6, 6, 6] expansion_factor: 2 resi_connection: 1conv ] path:[ pretrain_network_g: experiments/pretrained_models/DAT-S/DAT_S_x2.pth strict_load_g: True results_root: C:\Users\lenovo\Desktop\DAT-main\DAT-main\results\test_DAT_S_x2 log: C:\Users\lenovo\Desktop\DAT-main\DAT-main\results\test_DAT_S_x2 visualization: C:\Users\lenovo\Desktop\DAT-main\DAT-main\results\test_DAT_S_x2\visualization ] val:[ save_img: True suffix: None use_chop: False metrics:[ psnr:[ type: calculate_psnr crop_border: 2 test_y_channel: True ] ssim:[ type: calculate_ssim crop_border: 2 test_y_channel: True ] ] ] dist: False rank: 0 world_size: 1 auto_resume: False is_train: False

2024-05-08 16:48:55,367 INFO: Dataset [PairedImageDataset] - Set5 is built. 2024-05-08 16:48:55,368 INFO: Number of test images in Set5: 5 2024-05-08 16:48:55,374 INFO: Dataset [PairedImageDataset] - Set14 is built. 2024-05-08 16:48:55,374 INFO: Number of test images in Set14: 14 2024-05-08 16:48:55,385 INFO: Dataset [PairedImageDataset] - B100 is built. 2024-05-08 16:48:55,386 INFO: Number of test images in B100: 100 2024-05-08 16:48:55,395 INFO: Dataset [PairedImageDataset] - Urban100 is built. 2024-05-08 16:48:55,396 INFO: Number of test images in Urban100: 100 2024-05-08 16:48:55,407 INFO: Dataset [PairedImageDataset] - Manga109 is built. 2024-05-08 16:48:55,407 INFO: Number of test images in Manga109: 109 Name DATModel is not found, use name: DATModel_basicsr! Traceback (most recent call last): File "basicsr/test.py", line 44, in test_pipeline(root_path) File "basicsr/test.py", line 34, in test_pipeline model = build_model(opt) File "D:\ANACONDA\envs\DAT\lib\site-packages\basicsr\models__init__.py", line 26, in build_model model = MODEL_REGISTRY.get(opt['model_type'])(opt) File "D:\ANACONDA\envs\DAT\lib\site-packages\basicsr\utils\registry.py", line 71, in get raise KeyError(f"No object named '{name}' found in '{self._name}' registry!") KeyError: "No object named 'DATModel' found in 'model' registry!" 按照日志的提示对yml文件进行名称修改后仍会出现Name DATModel_basicsr_basicsr is not found, use name: DATModel_basicsr_basicsr_basicsr!问题,请问如何解决呢?

zhengchen1999 commented 1 month ago

不是yml的问题,是conda环境没有安装成功。具体参考 #1 。 如果无法解决,请删除DAT环境,重新安装一遍。

KershawTien commented 1 month ago

感谢您的解答,问题已经得到解决,谢谢