microsoft / microsoft/onnxruntime
Support pathlib.Path when paths are required in python module
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
Right now we only support string paths as in
rt.InferenceSession("myfile.pb")
We should support semantically accurate `pathlib.Path` types, too
rt.InferenceSession(Path("myfile.pb"))
and not throw an exception.
https://github.com/microsoft/onnxruntime/blob/f9bf546e3c19d1739590a24cfdf3b08a503f8c73/onnxruntime/python/session.py#L34-L42
Note: not just in InferenceSession but everywhere we require a path.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with onnxruntime/python/session.py at lines 34-42, then identify the other Python-module entry points that require paths. Check how those entry points handle string paths and determine the existing validation or test coverage before changing behavior. Done means pathlib.Path values are accepted everywhere paths are required without raising an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100