DeepDepthDenoising
DeepDepthDenoising copied to clipboard
RuntimeError
Hello, I am receiving errors when I test (using inference.py) with some custom images of different size and the error is as follows -
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 15 and 90 in dimension 2 at c:\a\w\1\s\tmp_conda_3.7_104535\conda\conda-bld\pytorch_1550400486030\work\aten\src\thc\generic/THCTensorMath.cu:83
This particular moment I had an image with dimensions 216*120
but I have had similar error for different sized images as well which were comparatively bigger.
Will you kindly tell what is causing this error and how can I get rid of it?
Hi,
the model supports 640x360 input resolution as input. Since you use a different resolution, I presume that the error is at the concatenation of an interpolation layer output with the features of the corresponding skip connection. This happens because the interpolation layers utilize the default h and w (360 and 640, see models/shallow_partial.py), while the skip connections feed the decoder with feature maps of your h' and w', where h' < h and w' < w (i.e. 15 < 90 in your case).
Hi @spthermo. Thank for the reply.
I get this part. But sometimes an image of 1280*720
has also been read but an image with dimensions 694*512
gives errors.
Also I have found another discrepancy, when my input image is in .jpg format, I am able to see the denoised depth image (output from inference.py) but can't see the denoised depth image when it is in .png format (it is totally black image everytime). Interestingly the pointclouds in both the cases are available and somewhat similar. Did you guys had the same observation while testing?
@spthermo yes,i also found input the png image will output the all black images,how to solve this?
@kearcer try to download another image viewer, like ImageJ
After loading a file with the load_depth function, the result should be an image tensor containing the depth values in meters (the scale parameter is responsible for that scaling, with the default value being 0.001
and assuming that the image contains the depth in millimeters).
Typical formats for depth images would be:
-
.exr
with raw float values (in arbitrary scaling, in the case of meters for example, it should beload_depth(filename, scale=1.0)
) -
.png
withunsigned short
(i.e.16bit
) values (usually in millimeters) -
.pgm
withunsigned short
(i.e.16bit
) values (usually in millimeters)
It should be noted that .jpeg
files are unsuitable to store depth values.
If you need more help with your files, please upload a sample that we can check.