isl-org / MiDaS

Code for robust monocular depth estimation described in "Ranftl et. al., Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer, TPAMI 2022"
MIT License
4.27k stars 599 forks source link

Allow for Pytorch 2.0 JIT tracing and torch onnx conversion. #220

Open ki-arie opened 1 year ago

ki-arie commented 1 year ago

Issue:

When creating ONNX file or Pytorch JIT trace, this utils file throws a type error, as the torch.Size() function expects an array of ints not torch tensors.

Fix:

Extract int from torch tensor, using .item()func call.

LWQ2EDU commented 9 months ago

the fix causes TracerWarning

16969026687986

maybe it's better to use the function in this issues

182