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

Add ONNX model hub python client #3663

Merged
merged 35 commits into from
Aug 30, 2021
Merged

Add ONNX model hub python client #3663

merged 35 commits into from
Aug 30, 2021

Conversation

mhamilton723
Copy link
Contributor

Please see model hub proposal and onnx/models manifest PR for more info.

@lgtm-com
Copy link

lgtm-com bot commented Aug 17, 2021

This pull request introduces 1 alert when merging dae42a1 into c24cd42 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@mhamilton723 mhamilton723 force-pushed the master branch 2 times, most recently from c2e196f to d545a05 Compare August 18, 2021 00:37
@lgtm-com
Copy link

lgtm-com bot commented Aug 18, 2021

This pull request introduces 1 alert when merging d545a05 into c24cd42 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

Copy link
Member

@linkerzhang linkerzhang left a comment

Choose a reason for hiding this comment

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

Good idea. However, I don't think it's a good idea to add this kind of tool into ONNX repo. Instead, it may be added into onnx/model or onnx/tools (if it's there).

onnx/hub.py Outdated Show resolved Hide resolved
onnx/hub.py Outdated
repo_branch = "master"

if lfs:
return "https://github.com/{}/{}/blob/{}/".format(repo_owner, repo_name, repo_branch)
Copy link
Contributor

Choose a reason for hiding this comment

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

For lfs, the download URL should be media.githubusercontent.com/media. See "download_url" field in link for example. And "raw=true" is no longer needed for this URL.

Suggested change
return "https://github.com/{}/{}/blob/{}/".format(repo_owner, repo_name, repo_branch)
return "https://media.githubusercontent.com/media/{}/{}/{}/".format(repo_owner, repo_name, repo_branch)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried this and unfortunately this 404s

Copy link
Contributor

Choose a reason for hiding this comment

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

That's weird. I tried "https://media.githubusercontent.com/media/mhamilton723/models/onnx-hub/vision/classification/resnet/model/resnet101-v1-7.onnx" and it's giving me the payload. Let me play with the code a bit more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

use ?raw=true

@lgtm-com
Copy link

lgtm-com bot commented Aug 18, 2021

This pull request introduces 1 alert when merging ef6420d into c24cd42 - view on LGTM.com

new alerts:

  • 1 for Unused import

@mhamilton723
Copy link
Contributor Author

Good idea. However, I don't think it's a good idea to add this kind of tool into ONNX repo. Instead, it may be added into onnx/model or onnx/tools (if it's there).

Thanks for the feedback @linkerzhang, some of the other folks in the community suggested we put this here because onnxmltools is just for converters. Do you have an email that I could loop into this discussion thread I just started? I can see motive for both and just want to ensure the community is aligned on what we should do.

@linkerzhang
Copy link
Member

Good idea. However, I don't think it's a good idea to add this kind of tool into ONNX repo. Instead, it may be added into onnx/model or onnx/tools (if it's there).

Thanks for the feedback @linkerzhang, some of the other folks in the community suggested we put this here because onnxmltools is just for converters. Do you have an email that I could loop into this discussion thread I just started? I can see motive for both and just want to ensure the community is aligned on what we should do.

my email is, linkerzhang@yeah.net.

How about onnx/model then?

@askhade
Copy link
Contributor

askhade commented Aug 19, 2021

The advantage of adding this to onnx main repo is it can be part of the onnx release package and then users can simply import onnx.hub and get models... There is no release package for onnx\models ...

@mhamilton723
Copy link
Contributor Author

Good idea. However, I don't think it's a good idea to add this kind of tool into ONNX repo. Instead, it may be added into onnx/model or onnx/tools (if it's there).

Thanks for the feedback @linkerzhang, some of the other folks in the community suggested we put this here because onnxmltools is just for converters. Do you have an email that I could loop into this discussion thread I just started? I can see motive for both and just want to ensure the community is aligned on what we should do.

my email is, linkerzhang@yeah.net.

How about onnx/model then?

We brought up this discussion in the steering committee and they mentioned onnx/onnx was the way to go to make it simple for folks to get started. onnx/model doesn't have any python package so it would be a big infra change and also less desireable from a easy user experience

onnx/hub.py Outdated Show resolved Hide resolved
@linkerzhang
Copy link
Member

Good idea. However, I don't think it's a good idea to add this kind of tool into ONNX repo. Instead, it may be added into onnx/model or onnx/tools (if it's there).

Thanks for the feedback @linkerzhang, some of the other folks in the community suggested we put this here because onnxmltools is just for converters. Do you have an email that I could loop into this discussion thread I just started? I can see motive for both and just want to ensure the community is aligned on what we should do.

my email is, linkerzhang@yeah.net.
How about onnx/model then?

We brought up this discussion in the steering committee and they mentioned onnx/onnx was the way to go to make it simple for folks to get started. onnx/model doesn't have any python package so it would be a big infra change and also less desireable from a easy user experience

OK. Thanks for clarification!

Copy link
Member

@linkerzhang linkerzhang left a comment

Choose a reason for hiding this comment

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

Interesting... 0 file changed?

@linkerzhang linkerzhang self-requested a review August 23, 2021 01:29
@memoryz
Copy link
Contributor

memoryz commented Aug 23, 2021

Interesting... 0 file changed?

Sorry my mistake - I just fixed the problem. Please check again.

@mhamilton723
Copy link
Contributor Author

mhamilton723 commented Aug 23, 2021

@askhade and @linkerzhang Ready for your review, thanks for your help!

@mhamilton723 mhamilton723 requested a review from askhade August 23, 2021 17:48
@memoryz memoryz force-pushed the master branch 2 times, most recently from f86e0c8 to 29fbeb3 Compare August 23, 2021 21:03
mhamilton723 and others added 16 commits August 26, 2021 13:14
Signed-off-by: Mark Hamilton <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Mark Hamilton <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Mark Hamilton <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Mark Hamilton <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Mark Hamilton <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Mark <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Mark <mhamilton723@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Guoyu Wang <wanggy@outlook.com>

Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Co-authored-by: Kevin Chen <45886021+kevinch-nv@users.noreply.github.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
Co-authored-by: pranavm-nvidia <49246958+pranavm-nvidia@users.noreply.github.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
… Fixing sorting order for opset.

Signed-off-by: Jason Wang <jasowang@microsoft.com>
Signed-off-by: Jason Wang <jasowang@microsoft.com>
memoryz and others added 2 commits August 26, 2021 13:16
@askhade
Copy link
Contributor

askhade commented Aug 26, 2021

CIs are failing because of flake8 errors:
onnx/hub.py:233:19: F523 '...'.format(...) has unused arguments at position(s): 0, 1
onnx/hub.py:239:1: W391 blank line at end of file
onnx/test/hub_test.py:79:1: W391 blank line at end of file
flake8 returned failures

@memoryz
Copy link
Contributor

memoryz commented Aug 26, 2021

CIs are failing because of flake8 errors:
onnx/hub.py:233:19: F523 '...'.format(...) has unused arguments at position(s): 0, 1
onnx/hub.py:239:1: W391 blank line at end of file
onnx/test/hub_test.py:79:1: W391 blank line at end of file
flake8 returned failures

Looking...

Signed-off-by: Jason Wang <jasowang@microsoft.com>
@memoryz
Copy link
Contributor

memoryz commented Aug 26, 2021

CIs are failing because of flake8 errors:
onnx/hub.py:233:19: F523 '...'.format(...) has unused arguments at position(s): 0, 1
onnx/hub.py:239:1: W391 blank line at end of file
onnx/test/hub_test.py:79:1: W391 blank line at end of file
flake8 returned failures

Fixed.

Copy link
Contributor

@rajeevnalawadi rajeevnalawadi left a comment

Choose a reason for hiding this comment

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

These changes look good

@prasanthpul prasanthpul dismissed linkerzhang’s stale review August 30, 2021 17:17

Ke has agreed in #3663 (comment) but has not been reachable to clear the review. Since there are a number of other approvals, dismissing the review to unblock on team.

@askhade askhade merged commit 208ac9b into onnx:master Aug 30, 2021
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.

9 participants