swz30 / MPRNet

[CVPR 2021] Multi-Stage Progressive Image Restoration. SOTA results for Image deblurring, deraining, and denoising.
Other
1.14k stars 187 forks source link

about test #136

Open yanghan0617 opened 6 months ago

yanghan0617 commented 6 months ago

When I was testing, I encountered the following problem:

File "F:\MPRNet-main\Deraining\MPRNet.py", line 187, in forward x = x + y RuntimeError: The size of tensor a (480) must match the size of tensor b (481) at non-singleton dimension 3

Please tell me how to solve it.

Eslzzyl commented 5 months ago

According to #78 and #14, you can run demo.py instead of Deraining/test.py. test.py only works on the given testing dataset which has resolution of 480x320, while demo.py has a block of code to handle images whose resolution is not a multiple of 16.

Here is an example worked for me:

# Rain100H
python demo.py \
    --input_dir ./Deraining/Datasets/test/Rain100H/input \
    --result_dir ./Deraining/results/Rain100H \
    --task Deraining

# Rain100L
python demo.py \
    --input_dir ./Deraining/Datasets/test/Rain100L/input \
    --result_dir ./Deraining/results/Rain100L \
    --task Deraining