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

RuntimeError #4

Open
Harleens13 opened this issue Jun 10, 2020 · 5 comments
Open

RuntimeError #4

Harleens13 opened this issue Jun 10, 2020 · 5 comments

Comments

@Harleens13
Copy link

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?

@spthermo
Copy link
Member

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).

@Harleens13
Copy link
Author

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?

@kearcer
Copy link

kearcer commented Aug 11, 2020

@spthermo yes,i also found input the png image will output the all black images,how to solve this?

@zapaishchykova
Copy link

@kearcer try to download another image viewer, like ImageJ

@zuru
Copy link
Member

zuru commented Sep 11, 2020

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 be load_depth(filename, scale=1.0))
  • .png with unsigned short (i.e. 16bit) values (usually in millimeters)
  • .pgm with unsigned 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.

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

5 participants