UniDepth
UniDepth copied to clipboard
encountered an AssertionError while using UniDepthV2 to predict depth
I really appreciate your great masterpiece. but I used UniDepthV2 to predict, encountered an AssertionError exception as below:
File "/home/user/app/app.py", line 23, in <module>
predictions = model.infer(rgb)
File "/home/user/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/user/app/unidepth/models/unidepthv2/unidepthv2.py", line 229, in infer
features, tokens = self.pixel_encoder(rgbs)
File "/home/user/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/user/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/home/user/app/unidepth/models/backbones/dinov2.py", line 324, in forward
x = self.prepare_tokens_with_masks(x, masks)
File "/home/user/app/unidepth/models/backbones/dinov2.py", line 312, in prepare_tokens_with_masks
x = x + self.interpolate_pos_encoding(x, w, h)
File "/home/user/app/unidepth/models/backbones/dinov2.py", line 297, in interpolate_pos_encoding
and int(h0) == patch_pos_embed.shape[-1]
my result is: int(w0)= 57,patch_pos_embed.shape[-2]= 57 and int(h0)= 43,patch_pos_embed.shape[-1]= 42