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

Missing squeeze? #42

Open
J4Q8 opened this issue Oct 25, 2024 · 0 comments
Open

Missing squeeze? #42

J4Q8 opened this issue Oct 25, 2024 · 0 comments

Comments

@J4Q8
Copy link

J4Q8 commented Oct 25, 2024

Hi!

Great work! I was running the plain version of depth anything V2 using your version pf dpt.py and I got the following error:

Traceback (most recent call last):
  File "run.py", line 57, in <module>
    depth = depth_anything.infer_image(raw_image, args.input_size)
  File "/usr/local/lib/python3.8/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/naisr/naisr_ws/nn_engine/Depth-Anything-V2/depth_anything_v2/dpt.py", line 193, in infer_image
    depth = F.interpolate(depth[:, None], (h, w), mode="bilinear", align_corners=True)[0, 0]
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/functional.py", line 3916, in interpolate
    raise ValueError(
ValueError: Input and output must have the same number of spatial dimensions, but got input with spatial dimensions of [1, 518, 924] and output size of (1080, 1920). Please provide input tensor in (N, C, d1, d2, ...,dK) format and output size in (o1, o2, ...,oK) format.

which I tracked down to a squeeze statement commented out here. Is there a particular reason it is commented out?

Best,
Jakub

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

1 participant