Using the --slim argument when running export.py leads to a FileNotFoundError.
Reproducible Example
Within a Bash shell, I used a fresh Python 3.11.9 virtual environment and I installed the requirements (after having pinned them with pip-tools).
Running the command
python export.py --model s --precision float16 --slim
fails and raises the error
Failed to slim model: [Errno 2] No such file or directory: 'python -m onnxslim weights/depth_anything_vits14_float16.onnx weights/depth_anything_vits14_float16_slim.onnx'
Description
Using the
--slim
argument when runningexport.py
leads to aFileNotFoundError
.Reproducible Example
Within a Bash shell, I used a fresh Python 3.11.9 virtual environment and I installed the requirements (after having pinned them with pip-tools).
Running the command
fails and raises the error
How to Fix
This is due to how the arguments are passed in the
subprocess.run
command below: https://github.com/fabio-sim/Depth-Anything-ONNX/blob/240f1303d99afb6c2c8100e2ff2f970f20d9c7f3/export.py#L115-L121We have to pass a list of arguments rather than a single string:
Since I know how to fix that, I can tackle this issue later.