fabio-sim / Depth-Anything-ONNX

ONNX-compatible Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data
Apache License 2.0
261 stars 26 forks source link

failed to export depth_anything_v2_metric_hypersim_vits.pth #23

Closed LyuDun closed 2 months ago

LyuDun commented 2 months ago

Hi! I am trying to export metric_hypersim_vits model, but it failed to run that scripts: python dynamo.py export --encoder vits --metric indoor --output weights/vits.onnx --opset 18

do you have any suggest or have plan upload onnx type hypersim vits model to release ?

some error output: C:\Users\HP\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\onnx_internal\exporter.py:137: UserWarning: torch.onnx.dynamo_export only implements opset version 18 for now. If you need to use a different opset version, please register them with register_custom_op. warnings.warn( ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\HP\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\onnx_internal\expor │ │ ter.py:1509 in dynamo_export │ │ │ │ 1506 │ │ │ model=model, │ │ 1507 │ │ │ model_args=model_args, │ │ 1508 │ │ │ model_kwargs=model_kwargs, │ │ ❱ 1509 │ │ ).export() │ │ 1510 │ except Exception as e: │ │ 1511 │ │ sarif_report_path = _DEFAULT_FAILED_EXPORT_SARIF_LOG_PATH │ │ 1512 │ │ resolved_export_options.diagnostic_context.dump(sarif_report_path)

fabio-sim commented 2 months ago

Hi @LyuDun, thank you for your interest in Depth-Anything-ONNX.

Please try the TorchScript/JIT-based export (since Dynamo is unstable). Are you referring to this model (indoor/hypersim)?: https://github.com/fabio-sim/Depth-Anything-ONNX/releases/download/v2.0.0/depth_anything_v2_vits_indoor_dynamic.onnx

LyuDun commented 2 months ago

Hi @LyuDun, thank you for your interest in Depth-Anything-ONNX.

Please try the TorchScript/JIT-based export (since Dynamo is unstable). Are you referring to this model (indoor/hypersim)?: https://github.com/fabio-sim/Depth-Anything-ONNX/releases/download/v2.0.0/depth_anything_v2_vits_indoor_dynamic.onnx

Thanks for your work. yes, thats the model, i think i missed it in the release.