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 the path error in export.py #5778

Merged
merged 3 commits into from
Nov 25, 2021
Merged

fix the path error in export.py #5778

merged 3 commits into from
Nov 25, 2021

Conversation

miknyko
Copy link
Contributor

@miknyko miknyko commented Nov 25, 2021

Hi, guys

I found a small bug in export.py.

the variable f is a pathlib.Path , which cannot be directly passed in scriptmodel.save

it has to be callled .as_posix() to get a string representation of the path

at least in windows

or there will be an error saying

TorchScript: export failure: save(): incompatible function arguments. The following argument types are supported: 1. (self: torch._C.ScriptModule, filename: str, _extra_files: Dict[str, str] = {}) -> None

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

This PR appears to be a placeholder or an error since there are no code changes.

📊 Key Changes

  • None, as the PR contains zero code changes.

🎯 Purpose & Impact

  • No impact on users or the codebase as no modifications were made.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

👋 Hello @miknyko, thank you for submitting a 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with upstream/master. If your PR is behind upstream/master an automatic GitHub actions rebase may be attempted by including the /rebase command in a comment body, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature  # <----- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
  • ✅ Verify all Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@glenn-jocher
Copy link
Member

@miknyko export works correctly, it is verified in our CI checks every 24 hours and on every commit:
https://github.com/ultralytics/yolov5/actions/runs/1501652617

If you find a reproducible bug please submit a bug report, thank you!

@glenn-jocher
Copy link
Member

Screenshot 2021-11-25 at 08 40 38

@glenn-jocher glenn-jocher merged commit c55e674 into ultralytics:master Nov 25, 2021
@miknyko miknyko deleted the export_fix branch November 25, 2021 08:00
@miknyko miknyko restored the export_fix branch November 25, 2021 08:00
@miknyko
Copy link
Contributor Author

miknyko commented Nov 25, 2021

I am using torch 1.7.1, and i afraid that in pytorch1.7 there is still no support for pathlib.windowsPurepath
image

@miknyko
Copy link
Contributor Author

miknyko commented Nov 25, 2021

and by the way im using python3.8

@glenn-jocher
Copy link
Member

@miknyko ah ok got it. Can you submit a PR to use a str() wrapper then around the Path object?

@miknyko
Copy link
Contributor Author

miknyko commented Nov 25, 2021

No problem

@miknyko miknyko deleted the export_fix branch November 25, 2021 08:51
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* fix the path error in export.py

* Update export.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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.

None yet

2 participants