onnx.load() has very limited support for loading models from the Path objects, especially when loading involves properly searching for external data. This causes the issue: https://app.asana.com/0/1206109050183159/1206486977947981/f - onnx tries to look for external data in the cwd and not in the directory where model.onnx is.
The solution is to refrain from using onnx.load(...) in favor of using our internal helper func load_model. That is slightly enhanced version of the func, that also works with Path objects.
2024-02-01 15:51:49 __main__ INFO Starting Analysis ...
INFO:__main__:Starting Analysis ...
INFO:root:Loading `model.onnx` from deployment directory /home/damian/.cache/sparsezoo/neuralmagic/codellama-7b-evolcodealpaca_codellama_pretrain-pruned60_quantized/deployment
EP Error narrowing_error when using ['CPUExecutionProvider']
Falling back to ['CPUExecutionProvider'] and retrying.
WARNING:sparsezoo.utils.node_inference:Extracting shapes using ONNX Runtime session failed: narrowing_error
WARNING:sparsezoo.utils.node_inference:Falling back to ONNX shape_inference
...
Note: it fails later on, but for that we have a separate ticket
onnx.load()
has very limited support for loading models from thePath
objects, especially when loading involves properly searching for external data. This causes the issue: https://app.asana.com/0/1206109050183159/1206486977947981/f - onnx tries to look for external data in the cwd and not in the directory wheremodel.onnx
is.The solution is to refrain from using
onnx.load(...)
in favor of using our internal helper funcload_model
. That is slightly enhanced version of the func, that also works withPath
objects.Now:
Does not fail on model loading:
Note: it fails later on, but for that we have a separate ticket