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

Use torch.jit.trace in unit-test #205

Merged
merged 5 commits into from
Oct 21, 2021
Merged

Use torch.jit.trace in unit-test #205

merged 5 commits into from
Oct 21, 2021

Conversation

nihui
Copy link
Contributor

@nihui nihui commented Oct 21, 2021

No description provided.

@CLAassistant
Copy link

CLAassistant commented Oct 21, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ zhiqwang
❌ nihui
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #205 (e97b14b) into main (fd53543) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #205   +/-   ##
=======================================
  Coverage   96.98%   96.98%           
=======================================
  Files          10       10           
  Lines         630      630           
=======================================
  Hits          611      611           
  Misses         19       19           
Flag Coverage Δ
unittests 96.98% <ø> (ø)

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


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 fd53543...e97b14b. Read the comment docs.

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 up @nihui , Thanks for your contributions here!



if __name__ == "__main__":

model = yolov5s(pretrained=True)
model.eval()
traced_model = get_trace_module(model, input_shape=(416, 352))
Copy link
Owner

Choose a reason for hiding this comment

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

Hi @nihui , I previously wrapped the torch.jit.trace in get_trace_module as follows. I changed your code here directly to this calling method. Also, I made some changes to the C++ part of the code to accommodate torch.jit.trace.

https://github.com/zhiqwang/yolov5-rt-stack/blob/fd53543e00b534ab11f5dfb689d4cdfb0160ad86/yolort/relaying/trace_wrapper.py#L37-L61

@zhiqwang zhiqwang merged commit 93a4d9f into zhiqwang:main Oct 21, 2021
@zhiqwang zhiqwang added the deployment Inference acceleration for production label Oct 21, 2021
@zhiqwang zhiqwang changed the title Update trace_model.py Use torch.jit.trace in unit-test Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Inference acceleration for production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants