lpiccinelli-eth / UniDepth

Universal Monocular Metric Depth Estimation
Other
462 stars 39 forks source link

TypeError while instantiating model using torch.hub.load #18

Closed quantumcoder121 closed 2 months ago

quantumcoder121 commented 2 months ago

The error is as follows:

File "/home/interns/.cache/torch/hub/lpiccinelli-eth_UniDepth_main/unidepth/utils/visualization.py", line 39, in def image_grid(imgs: list[np.ndarray], rows: int, cols: int) -> np.ndarray: TypeError: 'type' object is not subscriptable

lpiccinelli-eth commented 2 months ago

It is due to having an older python version, i.e. <3.9, and did not support typing with built-in classes (e.g. list instead of List from typing module).

If you do not want to upgrade python, I think you can solve with: from __future__ import annotations.

quantumcoder121 commented 2 months ago

Ic thx a lot well I just forked the repo and removed all the types in function declarations and it works well now closing the issue

quantumcoder121 commented 2 months ago

now closing the issue