Closed tamirs9876 closed 2 months ago
Hi @tamirs9876, thank you for your interest in Depth-Anything-ONNX.
I've added support for exporting dynamic shapes in #15.
Thanks, @fabio-sim, for your quick response!
I'm getting the same error as above after pulling the last commit (e25298b
, clean master
branch).
Here is the command I used:
python dynamo.py infer .\weights\depth_anything_v2_vitl.onnx -i assets\sacre_coeur1.jpg -d cpu -w 252 -h 252
RuntimeError: Error in execution: Got invalid dimensions for input: l_x_ for the following indices
index: 2 Got: 252 Expected: 518
index: 3 Got: 252 Expected: 518
Please fix either the inputs/outputs or the model.
If I omit the -w
and -h
parameters, I get the result as expected.
Did you export .\weights\depth_anything_v2_vitl.onnx
with dynamic axes? You can also try the already exported model here: https://github.com/fabio-sim/Depth-Anything-ONNX/releases/download/v2.0.0/depth_anything_v2_vitl_dynamic.onnx
Works as expected with *_dynamic.onnx
models, thanks!
Changing the input image size from 518x518 to another size which is a multiplier of 14, such as 364 or 560 result with an error:
Using input size other than 518 works as expected with Depth-Anything-ONNX V1 and also with the original Depth-Anything-V2 models.