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

how to test? #1

Closed
cheun726 opened this issue Jul 6, 2021 · 11 comments
Closed

how to test? #1

cheun726 opened this issue Jul 6, 2021 · 11 comments

Comments

@cheun726
Copy link

cheun726 commented Jul 6, 2021

I have got the pre-trained models, and i followed the test commend in demo.sh. But i got the following answer。
D:\softwarezijianzhuangde\anaconda\envs\pytorch-1.9\python.exe "D:/data/experiments code/code/1/Non-Local-Sparse-Attention/src/main.py" --dir_data ../benchmarkdata/benchmark/benchmark --model NLSN --chunk_size 144 --data_test Set5+Set14+B100+Urban100 --n_hashes 4 --chop --save_results --rgb_range 1 --data_range 801-900 --scale 2 --n_feats 256 --n_resblocks 32 --res_scale 0.1 --pre_train ../experiment/test/model/model_x2.pt --test_only
Making model...
Loading model from ../experiment/test/model/model_x2.pt
Total params: 41.80M

Evaluation:
[Set5 x2] PSNR: nan (Best: nan @epoch 1)
[Set14 x2] PSNR: nan (Best: nan @epoch 1)
[B100 x2] PSNR: nan (Best: nan @epoch 1)
[Urban100 x2] PSNR: nan (Best: nan @epoch 1)
Forward: 0.00s

Saving...
Total: 0.00s

0it [00:00, ?it/s]
0it [00:00, ?it/s]
0it [00:00, ?it/s]
0it [00:00, ?it/s]

Process finished with exit code 0
please help me.

@HarukiYqM
Copy link
Owner

Hi, please set the dir_data to the directory that contains the benchmark folder.

@cheun726
Copy link
Author

cheun726 commented Jul 6, 2021

i have done so.i set it up like this
parser.add_argument('--dir_data', type=str, default='D:\data\experiments code\code\1\Non-Local-Sparse-Attention\benchmarkdata\benchmark\benchmark',
help='dataset directory')

@HarukiYqM
Copy link
Owner

HarukiYqM commented Jul 6, 2021

Hi, the directory should contain the folder benchmark not the folder like Set5. In your case, it may be 'D:\data\experiments code\code\1\Non-Local-Sparse-Attention\benchmarkdata\benchmark\’.

@cheun726
Copy link
Author

cheun726 commented Jul 6, 2021

My operating system is Windows 10.Do I need to change demo.sh?I changed it to look like this.Is that right
--dir_data ../benchmark --model NLSN --chunk_size 144 --data_test Set5+Set14+B100+Urban100 --n_hashes 4 --chop --save_results --rgb_range 1 --data_range 801-900 --scale 2 --n_feats 256 --n_resblocks 32 --res_scale 0.1 --pre_train ../experiment/test/model/model_x2.pt --test_only

@cheun726
Copy link
Author

cheun726 commented Jul 6, 2021

I changed it as you said.And that's what happened
D:\softwarezijianzhuangde\anaconda\envs\pytorch-1.9\python.exe "D:/data/experiments code/code/1/Non-Local-Sparse-Attention/src/main.py" --dir_data ../benchmark --model NLSN --chunk_size 144 --data_test Set5+Set14+B100+Urban100 --n_hashes 4 --chop --save_results --rgb_range 1 --data_range 801-900 --scale 2 --n_feats 256 --n_resblocks 32 --res_scale 0.1 --pre_train ../experiment/test/model/model_x2.pt --test_only
Making model...
Loading model from ../experiment/test/model/model_x2.pt
0it [00:00, ?it/s]
0it [00:00, ?it/s]
0it [00:00, ?it/s]
0it [00:00, ?it/s]
Total params: 41.80M

Evaluation:
[Set5 x2] PSNR: nan (Best: nan @epoch 1)
[Set14 x2] PSNR: nan (Best: nan @epoch 1)
[B100 x2] PSNR: nan (Best: nan @epoch 1)
[Urban100 x2] PSNR: nan (Best: nan @epoch 1)
Forward: 0.00s

Saving...
Total: 0.00s

Process finished with exit code 0

@HarukiYqM
Copy link
Owner

HarukiYqM commented Jul 6, 2021

The problem is the datasets are not correctly loaded. After you extracting the datasets, the structure should like this,
—/somepath/somefolder
——benchmark
———Set5
———Set14
———B100
———Urban100
And set the dir_data as /somepath/somefolder

@cheun726
Copy link
Author

cheun726 commented Jul 6, 2021

It does not work.
In option.py,i set the dir_data like this
parser.add_argument('--dir_data', type=str, default='D:\data\experiments code\code\1\Non-Local-Sparse-Attention\benchmarkdata\benchmark',
help='dataset directory')
In demo.sh,i set it like this
--dir_data ../D:/data/experiments code/code/1/Non-Local-Sparse-Attention/benchmarkdata --model NLSN --chunk_size 144 --data_test Set5+Set14+B100+Urban100 --n_hashes 4 --chop --save_results --rgb_range 1 --data_range 801-900 --scale 2 --n_feats 256 --n_resblocks 32 --res_scale 0.1 --pre_train ../experiment/test/model/model_x2.pt --test_only
I don't know the exact reasons.please help me.Thanks

@HarukiYqM
Copy link
Owner

HarukiYqM commented Jul 6, 2021

Hi, after extracting the zip file, you should get a folder with name “benchmark”. What is the parent folder that contains the benchmark folder? Please set the dir_data to a path pointing to the parent folder in the demo.sh.

In addition, please make sure the grammar for windows is correct.

@cheun726
Copy link
Author

cheun726 commented Jul 6, 2021

A new problem has arisen。
D:\softwarezijianzhuangde\anaconda\envs\pytorch-1.9\python.exe "D:/data/experiments code/code/1/Non-Local-Sparse-Attention/src/main.py" --dir_data ../benchmarkdata --model NLSN --chunk_size 144 --data_test Set5+Set14+B100+Urban100 --n_hashes 4 --chop --save_results --rgb_range 1 --data_range 801-900 --scale 2 --n_feats 256 --n_resblocks 32 --res_scale 0.1 --pre_train ../experiment/test/model/model_x2.pt --test_only
Making model...
Loading model from ../experiment/test/model/model_x2.pt
Total params: 41.80M

Evaluation:
0%| | 0/5 [00:03<?, ?it/s]
Traceback (most recent call last):
File "D:/data/experiments code/code/1/Non-Local-Sparse-Attention/src/main.py", line 35, in
main()
File "D:/data/experiments code/code/1/Non-Local-Sparse-Attention/src/main.py", line 28, in main
while not t.terminate():
File "D:\data\experiments code\code\1\Non-Local-Sparse-Attention\src\trainer.py", line 141, in terminate
self.test()
File "D:\data\experiments code\code\1\Non-Local-Sparse-Attention\src\trainer.py", line 102, in test
self.ckp.save_results(d, filename[0], save_list, scale)
File "D:\data\experiments code\code\1\Non-Local-Sparse-Attention\src\utility.py", line 159, in save_results
self.queue.put(('{}{}.png'.format(filename, p), tensor_cpu))
AttributeError: 'checkpoint' object has no attribute 'queue'

Process finished with exit code 1

@HarukiYqM
Copy link
Owner

HarukiYqM commented Jul 6, 2021

Hi, I am not sure about this problem. It may be because torch version and windows platform. The code is tested on Linux.
This code is based on EDSR and you may want to look this issue for reference sanghyun-son/EDSR-PyTorch#91.

@cheun726
Copy link
Author

cheun726 commented Jul 6, 2021

thank you very much

@HarukiYqM HarukiYqM mentioned this issue Sep 10, 2021
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