Skip to content

Missing squeeze? #42

@J4Q8

Description

@J4Q8

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions