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

Allow loading of user-trained ultralytics models #79

Merged
merged 12 commits into from
Mar 20, 2021

Conversation

dkloving
Copy link
Contributor

Allows the user to specify a file to use when loading an ultralytics model for conversion. This is valuable for users who have already trained their models using ultralytics and don't wish to re-train.

Optional disabling of fp16 conversion is provided to users because some custom ultralytics models have been observed to not convert entirely to fp16 upon export to onnx, creating invalid onnx model files. Ideally this can be fixed to reliably convert all ultralytics models to fp16.

Support loading ultralytics model with custom weights
bugfix for custom yolov5 models.
Update update_module_state.py
allow selective conversion to fp16, ultralytics version other than la…
bugfix, was not returning updated model
@codecov
Copy link

codecov bot commented Mar 15, 2021

Codecov Report

Merging #79 (d3b486a) into master (2332a2c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #79   +/-   ##
=======================================
  Coverage   81.79%   81.79%           
=======================================
  Files           8        8           
  Lines         736      736           
=======================================
  Hits          602      602           
  Misses        134      134           
Flag Coverage Δ
unittests 81.79% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
test/test_utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2332a2c...d3b486a. Read the comment docs.

@zhiqwang zhiqwang self-requested a review March 16, 2021 02:46
@zhiqwang zhiqwang added the enhancement New feature or request label Mar 16, 2021
Copy link
Owner

@zhiqwang zhiqwang left a comment

Choose a reason for hiding this comment

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

Hi @dkloving , Thank you for your pull request and welcome to our community.

I have a comment about the parameter naming rule, which could be more user-friendly, let me know your thoughts?

yolort/utils/update_module_state.py Outdated Show resolved Hide resolved
yolort/utils/update_module_state.py Outdated Show resolved Hide resolved
@zhiqwang
Copy link
Owner

zhiqwang commented Mar 16, 2021

Because of some limitations in my design here, the current parameter configuration is still a bit complicated. For example, when users train their tasks, the num_classes is not 80 in most cases, and this may cause problems. We could add a detailed usage instruction in a follow-up PR or improve this in this PR. And let me know if you prefer to improve this in this PR.

@zhiqwang
Copy link
Owner

zhiqwang commented Mar 20, 2021

Hi @dkloving ,

I've added some commits directly on your branch. It would be better if we could add a unit-test for updating custom model checkpoint trained from ultralytics, but let's merge this PR first for more feedbacks in the future!

If you have more questions, fell free to open a new issue or submit a PR about it. And thanks for your contribution here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants