hezhangsprinter / DCPDN

Densely Connected Pyramid Dehazing Network (CVPR'2018)
401 stars 112 forks source link

Can DCPDN only handle fixed-size images? #13

Closed HouMInJun closed 6 years ago

HouMInJun commented 6 years ago

Excuse me,I can only successfully run the program on fixed-size test images, such as 512×512 or 1024×1024. When I tested DCPDN on a 574× 829 image, I got an error: RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 574 and 576 in dimension 2 at c:\anaconda2\conda-bld\pytorch_1519492996300\work\torch\lib\thc\generic/THCTensorMath.cu:111

How can I solve this problem? I am looking forward to and thank you for your reply!

hezhangsprinter commented 6 years ago

Yeah. It can only handle size with like 512, 256, which is the multiplier of 128 or 64. If you really care about the resolution, you can pad first to size of the multiplier of 128 and then un-padded afterwards.

If you doesn't care resolution that much, you can resize the image to eg. 512X512 first and then resize to the original resolution.