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

Update export.py #5471

Merged
merged 5 commits into from
Nov 5, 2021
Merged

Update export.py #5471

merged 5 commits into from
Nov 5, 2021

Conversation

nanmi
Copy link
Contributor

@nanmi nanmi commented Nov 3, 2021

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

This PR appears to be either an empty or placeholder PR, with no code changes included.

📊 Key Changes

  • There are no code changes to highlight as the PR diff is empty.

🎯 Purpose & Impact

  • Without code changes, there's no direct impact on the software or users.
  • It could be a PR for discussion, planning, or an error that needs to be closed without merging.

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 @nanmi, 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

@nanmi hi there. What is the bug you are trying to fix with this? For ONNX dynamic models the correct export command is:

python export.py --include onnx --dynamic

@nanmi
Copy link
Contributor Author

nanmi commented Nov 4, 2021

@nanmi你好。您要修复的错误是什么?对于 ONNX 动态模型,正确的导出命令是:

python export.py --include onnx --dynamic

@glenn-jocher Hi, when I fine tune the model and save onnx directly, it is easy to generate output the processing after the detection head, if I export the pre training model onnx separately, there will be no error 😀

@glenn-jocher
Copy link
Member

@nanmi I'm sorry I'm not understanding. The Detect layer onnx_dynamic attribute is already set correctly here:

yolov5/export.py

Lines 293 to 295 in ac2c49a

elif isinstance(m, Detect):
m.inplace = inplace
m.onnx_dynamic = dynamic

If you are seeing an error in YOLOv5 that this PR is fixing, please raise a bug report first and then link this PR to it as a solution. As is I don't understand the problem this PR is fixing.

@glenn-jocher
Copy link
Member

/rebase

@glenn-jocher glenn-jocher changed the title fix export onnx bug Update export.py Nov 5, 2021
@glenn-jocher glenn-jocher merged commit 98a3fd7 into ultralytics:master Nov 5, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* fix export onnx bug

* Update export.py

* Update export.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update yolo.py

Co-authored-by: Glenn Jocher <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

2 participants