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

No results? #40

Open
AIisCool opened this issue Apr 13, 2022 · 8 comments
Open

No results? #40

AIisCool opened this issue Apr 13, 2022 · 8 comments

Comments

@AIisCool
Copy link

AIisCool commented Apr 13, 2022

python main.py --dir_data "C:/Pretrained-IPT-main/test_data/" --pretrain "C:/Pretrained-IPT-main/model/IPT_denoise30.pt" --data_test "BW" --scale 1 --denoise --sigma 30 --test_only

100%|###########################################| 39/39 [06:49<00:00, 10.51s/it]
Making model...

Evaluation:
[BW x1] PSNR: 38.132 (Best: 38.132 @epoch 1)
Forward: 409.81s

Saving...
Total: 409.81s

No denoised images in any folders?

If I change "test_only" to --save or --save_results I get: ValueError: num_samples should be a positive integer value, but got num_samples=0

@AIisCool AIisCool changed the title ValueError: num_samples should be a positive integer value, but got num_samples=0 No results? Apr 13, 2022
@HantingChen
Copy link
Collaborator

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

@AIisCool
Copy link
Author

Yes I have it like this: C:\Pretrained-IPT-main\test_data\benchmark\BW\000.png

@HantingChen
Copy link
Collaborator

Maybe you should rename your dataset as CBSD68, since we do not write codes for dataset BW.

@AIisCool
Copy link
Author

I tried. I thought adding "BW" to this would work? Was in a different issue thread.

self.loader_test = [] for d in args.data_test: if d in ['Set5', 'Set14', 'B100', 'Urban100', 'Manga109','CBSD68','Rain100L','GOPRO_Large', 'BW']:

@HantingChen
Copy link
Collaborator

HantingChen commented Apr 14, 2022

I tried. I thought adding "BW" to this would work? Was in a different issue thread.

self.loader_test = [] for d in args.data_test: if d in ['Set5', 'Set14', 'B100', 'Urban100', 'Manga109','CBSD68','Rain100L','GOPRO_Large', 'BW']:

Yes, I think this should work.

Another strightforward solution is to rename your folder 'BW' as 'CBSD68' and set --data_test "CBSD68".

@AIisCool
Copy link
Author

Tried renaming, same issue unforunately.

  File "C:\Pretrained-IPT-main\main.py", line 37, in <module>
    main()
  File "C:\Pretrained-IPT-main\main.py", line 22, in main
    loader = data.Data(args)
  File "C:\Pretrained-IPT-main\data\__init__.py", line 30, in __init__
    self.loader_train = dataloader.DataLoader(
  File "C:\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 268, in __init__
    sampler = RandomSampler(dataset, generator=generator)
  File "C:\Python39\lib\site-packages\torch\utils\data\sampler.py", line 102, in __init__
    raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

@HantingChen
Copy link
Collaborator

HantingChen commented Apr 15, 2022

Tried renaming, same issue unforunately.

  File "C:\Pretrained-IPT-main\main.py", line 37, in <module>
    main()
  File "C:\Pretrained-IPT-main\main.py", line 22, in main
    loader = data.Data(args)
  File "C:\Pretrained-IPT-main\data\__init__.py", line 30, in __init__
    self.loader_train = dataloader.DataLoader(
  File "C:\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 268, in __init__
    sampler = RandomSampler(dataset, generator=generator)
  File "C:\Python39\lib\site-packages\torch\utils\data\sampler.py", line 102, in __init__
    raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

This is strange. Can the codes work well if you using the original CBSD68 dataset?

@AIisCool
Copy link
Author

Can the codes work well if you using the original CBSD68 dataset?

If I do --test_only, then yes.

100%|###########################################| 39/39 [06:39<00:00, 10.25s/it]
Making model...

Evaluation:
[CBSD68 x1]     PSNR: 38.132 (Best: 38.132 @epoch 1)
Forward: 399.89s

Saving...
Total: 399.89s

If I do --save_results, I get the same error.

Traceback (most recent call last):
  File "C:\Pretrained-IPT-main\main.py", line 37, in <module>
    main()
  File "C:\Pretrained-IPT-main\main.py", line 22, in main
    loader = data.Data(args)
  File "C:\Pretrained-IPT-main\data\__init__.py", line 30, in __init__
    self.loader_train = dataloader.DataLoader(
  File "C:\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 268, in __init__
    sampler = RandomSampler(dataset, generator=generator)
  File "C:\Python39\lib\site-packages\torch\utils\data\sampler.py", line 102, in __init__
    raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

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