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

初学者想复现你们的评估结果遇到的问题 #27

Open
windZhangAZ opened this issue Dec 16, 2021 · 5 comments
Open

初学者想复现你们的评估结果遇到的问题 #27

windZhangAZ opened this issue Dec 16, 2021 · 5 comments

Comments

@windZhangAZ
Copy link

1.比如说去雨
我的指令是:
python main.py --dir_data test_data/benchmark/ --pretrain pretrained_model/ --scale 1 --derain
我是将‘Rain100L’和‘RainTrainL’两个数据集放在了 test_data/benchmark/ 路径下。
报错是:
File "C:\Users\10446\Desktop\课程资料\Pretrained-IPT-main\data\srdata.py", line 29, in search
elif path.split('/')[-2] == target or path.split('/')[-3] == target or path.split('/')[-4] == target:
IndexError: list index out of range
是因为在win10 环境没在linux环境下运行还是其他原因?

  1. 我要得到评估结果,比如denoise sigma 30 是否只需要将CBSD68+Urban100这两个数据集的模糊化 放在--dir_data $DATA_PATH 路径下就行 还是对数据集里的图片或者路径有命名要求。 比如我看到去雨的时候图片名称要有‘rain’ ‘norain ’ 还有文件夹要命名为‘Rain100L’,‘RainTrainL’。
  2. 如果只是要评估结果 为什么评估去雨的时候要用到RainTrainL这个训练集。
    多谢解答!
@windZhangAZ
Copy link
Author

去雨的时候 命令
python main.py --dir_data test_data/benchmark/ --pretrain pretrained_model/ --scale 1 --derain

‘Rain100L’,‘RainTrainL’ 都在test_data/benchmark/下
错误:
Traceback (most recent call last):
File "main.py", line 37, in
main()
File "main.py", line 22, in main
loader = data.Data(args)
File "/mnt/Pretrained-IPT-main/data/init.py", line 35, in init
num_workers=args.n_threads,
File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 266, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore
File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 104, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integer value, but got num_samples=0
麻烦指正。

@HantingChen
Copy link
Collaborator

  1. rain100L数据集的命名应该是norain-001.png和rain-001.png这样的格式,由于rain100L数据集的版本不止一个,请确定下载了正确版本的rain100L,我们使用的是和对比论文里相同版本的数据集,可以参考:https://github.com/csdwren/PReNet. 测试时不需要用到RainTrainL这个数据集,相应代码已经修改。
  2. 数据集具体路径可以参考:

Evaluation Process

Inference example:
For SR x2,x3,x4:

python main.py --dir_data $DATA_PATH --pretrain $MODEL_PATH --data_test Set5+Set14+B100+Urban100 --scale $SCALE

Note: path of images should be like: $MODEL_PATH/benchmark/Set5/HR/XXX.png and $MODEL_PATH/benchmark/Set5/LR_bicubic/XXX.png

For Denoise 30,50:

python main.py --dir_data $DATA_PATH --pretrain $MODEL_PATH --data_test CBSD68+Urban100 --scale 1 --denoise --sigma $NOISY_LEVEL

Note: path of images should be like: $MODEL_PATH/benchmark/CBSD68/XXX.png

For derain:

python main.py --dir_data $DATA_PATH --pretrain $MODEL_PATH --scale 1 --derain

Note: path of images should be like: $MODEL_PATH/Rain100L/rain-XXX.png and $MODEL_PATH/Rain100L/norain-XXX.png

@zyjlxx
Copy link

zyjlxx commented Feb 4, 2022

1.比如说去雨 我的指令是: python main.py --dir_data test_data/benchmark/ --pretrain pretrained_model/ --scale 1 --derain 我是将‘Rain100L’和‘RainTrainL’两个数据集放在了 test_data/benchmark/ 路径下。 报错是: File "C:\Users\10446\Desktop\课程资料\Pretrained-IPT-main\data\srdata.py", line 29, in search elif path.split('/')[-2] == target or path.split('/')[-3] == target or path.split('/')[-4] == target: IndexError: list index out of range 是因为在win10 环境没在linux环境下运行还是其他原因?

  1. 我要得到评估结果,比如denoise sigma 30 是否只需要将CBSD68+Urban100这两个数据集的模糊化 放在--dir_data $DATA_PATH 路径下就行 还是对数据集里的图片或者路径有命名要求。 比如我看到去雨的时候图片名称要有‘rain’ ‘norain ’ 还有文件夹要命名为‘Rain100L’,‘RainTrainL’。
  2. 如果只是要评估结果 为什么评估去雨的时候要用到RainTrainL这个训练集。
    多谢解答!

也是初学者遇到同样问题,没能解决

@zyjlxx
Copy link

zyjlxx commented Feb 4, 2022

数据集是从https://github.com/csdwren/PReNet.这下载的,elif path.split('/')[-2] == target or path.split('/')[-3] == target or path.split('/')[-4] == target这行注释掉,得到这样的问题ValueError: num_samples should be a positive integer value, but got num_samples=0

@Shujia602
Copy link

"Note: path of images should be like: $MODEL_PATH/benchmark/Set5/HR/XXX.png and $MODEL_PATH/benchmark/Set5/LR_bicubic/XXX.png"为什么数据集是放在$MODEL_PATH下面?我没看错吧?

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

4 participants