Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix load failure for onnx model with external data and slash (/) in path [Windows] #11793

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Jun 8, 2022

Description:

GetDirNameFromFilePath currently assumes path using backslash. If user gives a ONNX model with external data, and path uses slash (/) instead of backslash (\), ORT cannot extract the directory from path to locate external data file.

Motivation and Context

  • Why is this change required? What problem does it solve?
  • If it fixes an open issue, please link to the issue here.

Related issues: #5418, #11708

@tianleiwu tianleiwu changed the title [WIP] Fix load failure for onnx model with slash (/) in path [Windows] [WIP] Fix load failure for onnx model with external data and slash (/) in path [Windows] Jun 8, 2022
Copy link
Member

@snnn snnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On windows we can use std::filesystem which actually eases a lot of things.

@tianleiwu tianleiwu changed the title [WIP] Fix load failure for onnx model with external data and slash (/) in path [Windows] Fix load failure for onnx model with external data and slash (/) in path [Windows] Jun 10, 2022
@tianleiwu tianleiwu merged commit 768b9cf into master Jun 10, 2022
@tianleiwu tianleiwu deleted the tlwu/fix_windows_slash_path branch June 10, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants