Zj-BinXia / AMSA

This project is the official implementation of 'Coarse-to-Fine Embedded PatchMatch and Multi-Scale Dynamic Aggregation for Reference-based Super-Resolution', AAAI2022
69 stars 5 forks source link

windows中怎么修改make.sh文件中的路径 #7

Closed CodeMadUser closed 2 years ago

CodeMadUser commented 2 years ago

你好,作者,在进行源码测试时出现无法指定cuda路径,CUDA装在C盘了,买办法指定该怎么解决?感谢 这是我的路径: CUDA_HOME=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1 \ CUDNN_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/include \ CUDNN_LIB_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/lib64 \ python setup.py build develop 但是无法找到。

Zj-BinXia commented 2 years ago

你好,我是在linux上测试的,所以没有遇到过这问题。我的代码是基于BasicSR改的,可以去这边问问https://github.com/XPixelGroup/BasicSR 在windows下的编译办法。

CodeMadUser commented 2 years ago

你好,我是在linux上测试的,所以没有遇到过这问题。我的代码是基于BasicSR改的,可以去这边问问https://github.com/XPixelGroup/BasicSR 在windows下的编译办法。

好的,感谢。

CodeMadUser commented 2 years ago

你好,我是在linux上测试的,所以没有遇到过这问题。我的代码是基于BasicSR改的,可以去这边问问https://github.com/XPixelGroup/BasicSR 在windows下的编译办法。

你好,还有在进行权重加载的时候,有个restoration.pth是在哪里下载呢?我是在你链接的项目里下载的,只是简单修改了权重名字,在初始化的时候出现了参数缺失: 2022-07-30 17:56:32,899.899 - INFO: Loading RestorationNet model from D:/pythonProject/7_4/sr/AMSA-master/AMSA/experiments/pretrained_models/restoration.pth. 2022-07-30 17:56:32,958.958 - WARNING: Current net - loaded net: 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.bias 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.conv_offset_mask.bias 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.conv_offset_mask.weight 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.weight 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.medium_deform_conv.bias 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.medium_deform_conv.conv_offset_mask.bias 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.medium_deform_conv.conv_offset_mask.weight 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.medium_deform_conv.weight 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.small_deform_conv.bias 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.small_deform_conv.conv_offset_mask.bias 2022-07-30 17:56:32,961.961 - WARNING: dyn_agg_restore.small_deform_conv.conv_offset_mask.weight 2022-07-30 17:56:32,961.961 - WARNING: dyn_agg_restore.small_deform_conv.weight 2022-07-30 17:56:32,961.961 - WARNING: Loaded net - current net: Traceback (most recent call last): File "test.py", line 152, in main() File "test.py", line 57, in main model = create_model(opt) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models__init.py", line 39, in create_model model = model_cls(opt) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models\ref_restoration_model.py", line 23, in init super(RefRestorationModel, self).init(opt) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models\sr_model.py", line 36, in init self.opt['path']['strict_load']) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models\base_model.py", line 265, in load_network net.load_state_dict(load_net, strict=strict) File "D:\python3.7\lib\site-packages\torch\nn\modules\module.py", line 1052, in load_state_dict self.class.name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for RestorationNet: Missing key(s) in state_dict: "dyn_agg_restore.small_deform_conv.weight", "dyn_agg_restore.small_deform_conv.bias", "dyn_agg_restore.small_deform_conv.conv_offset_mask.weight", "dyn_agg_restore.small_deform_conv.convoffset mask.bias", "dyn_agg_restore.medium_deform_conv.weight", "dyn_agg_restore.medium_deform_conv.bias", "dyn_agg_restore.medium_deform_conv.conv_offset_mask.weight", "dyn_agg_restore.medium_deform_conv.conv_offset_mask.bias", "dyn_agg_r estore.large_deform_conv.weight", "dyn_agg_restore.large_deform_conv.bias", "dyn_agg_restore.large_deform_conv.conv_offset_mask.weight", "dyn_agg_restore.large_deform_conv.conv_offset_mask.bias".

请问该怎么解决呢?

Zj-BinXia commented 2 years ago

你好,我是在linux上测试的,所以没有遇到过这问题。我的代码是基于BasicSR改的,可以去这边问问https://github.com/XPixelGroup/BasicSR 在windows下的编译办法。

你好,还有在进行权重加载的时候,有个restoration.pth是在哪里下载呢?我是在你链接的项目里下载的,只是简单修改了权重名字,在初始化的时候出现了参数缺失: 2022-07-30 17:56:32,899.899 - INFO: Loading RestorationNet model from D:/pythonProject/7_4/sr/AMSA-master/AMSA/experiments/pretrained_models/restoration.pth. 2022-07-30 17:56:32,958.958 - WARNING: Current net - loaded net: 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.bias 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.conv_offset_mask.bias 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.conv_offset_mask.weight 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.large_deform_conv.weight 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.medium_deform_conv.bias 2022-07-30 17:56:32,959.959 - WARNING: dyn_agg_restore.medium_deform_conv.conv_offset_mask.bias 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.medium_deform_conv.conv_offset_mask.weight 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.medium_deform_conv.weight 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.small_deform_conv.bias 2022-07-30 17:56:32,960.960 - WARNING: dyn_agg_restore.small_deform_conv.conv_offset_mask.bias 2022-07-30 17:56:32,961.961 - WARNING: dyn_agg_restore.small_deform_conv.conv_offset_mask.weight 2022-07-30 17:56:32,961.961 - WARNING: dyn_agg_restore.small_deform_conv.weight 2022-07-30 17:56:32,961.961 - WARNING: Loaded net - current net: Traceback (most recent call last): File "test.py", line 152, in main() File "test.py", line 57, in main model = create_model(opt) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\modelsinit.py", line 39, in create_model model = model_cls(opt) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models\ref_restoration_model.py", line 23, in init super(RefRestorationModel, self).init(opt) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models\sr_model.py", line 36, in init self.opt['path']['strict_load']) File "D:\pythonProject\7_4\sr\AMSA-master\AMSA\mmsr\models\base_model.py", line 265, in load_network net.load_state_dict(load_net, strict=strict) File "D:\python3.7\lib\site-packages\torch\nn\modules\module.py", line 1052, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for RestorationNet: Missing key(s) in state_dict: "dyn_agg_restore.small_deform_conv.weight", "dyn_agg_restore.small_deform_conv.bias", "dyn_agg_restore.small_deform_conv.conv_offset_mask.weight", "dyn_agg_restore.small_deform_conv.convoffset mask.bias", "dyn_agg_restore.medium_deform_conv.weight", "dyn_agg_restore.medium_deform_conv.bias", "dyn_agg_restore.medium_deform_conv.conv_offset_mask.weight", "dyn_agg_restore.medium_deform_conv.conv_offset_mask.bias", "dyn_agg_r estore.large_deform_conv.weight", "dyn_agg_restore.large_deform_conv.bias", "dyn_agg_restore.large_deform_conv.conv_offset_mask.weight", "dyn_agg_restore.large_deform_conv.conv_offset_mask.bias".

请问该怎么解决呢?

是不是下载错checkpoint了,这个链接里的chenckpoint只需要feature_extraction.pth,剩下的AMSA.pth在上面的那个链接里下载的

Zj-BinXia commented 2 years ago

你把测试的和训练的预训练模型搞混了

CodeMadUser commented 2 years ago

你把测试的和训练的预训练模型搞混了

非常感谢你的回复与提醒,已经可以正常测试代码。非常感谢,只是效果感觉有些不太理想。

Zj-BinXia commented 2 years ago

Patchmatch因为随机匹配性问题指标存在一定的波动性,可以多做几次试验。如果说想减少这种随机性,也可以通过加大迭代次数解决。

CodeMadUser commented 2 years ago

好的,我再测试测试,再来和您交流。感谢

Zj-BinXia commented 2 years ago

请问你的问题解决了吗?最近有人报到说复现指标比论文中低了0.07dB,这其实是PatchMatch随机种子不同造成的指标波动。但为了方便复现,我重新固定了随机种子,再google drive上上传了新的模型,可以直接得到与论文上一致的结果。

CodeMadUser commented 2 years ago

请问你的问题解决了吗?最近有人报到说复现指标比论文中低了0.07dB,这其实是PatchMatch随机种子不同造成的指标波动。但为了方便复现,我重新固定了随机种子,再google drive上上传了新的模型,可以直接得到与论文上一致的结果。

你好作者,我没有计算指标大小,我会再使用提供新的权重进行测试,非常感谢。非常棒的工作。