-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Python] Support loading of TF models with saved weights #25496
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25496 +/- ##
==========================================
+ Coverage 72.20% 72.81% +0.60%
==========================================
Files 772 751 -21
Lines 102264 99590 -2674
==========================================
- Hits 73838 72514 -1324
+ Misses 26992 25715 -1277
+ Partials 1434 1361 -73
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Run Python_PVR_Flink PreCommit |
Run Python 3.8 PostCommit |
Run Python 3.8 PostCommit |
I think you need to pull in master to avoid postcommit failures (fixed by #25446) |
Run Python 3.8 PostCommit |
Run Python_Dataframes PreCommit |
Run Whitespace PreCommit |
Run Python 3.8 PostCommit |
Assigning reviewers. If you would like to opt out of this review, comment R: @tvalentyn for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
sdks/python/setup.py
Outdated
@@ -286,6 +286,7 @@ def get_portability_package_data(): | |||
'pytest-xdist>=2.5.0,<3', | |||
'pytest-timeout>=2.1.0,<3', | |||
'scikit-learn>=0.20.0', | |||
'tensorflow>=1.0.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(drive-by comment): let's not depend on a large dependency like this by default. you can see how we deal with sklearn/pytorch in similar circumstances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @tvalentyn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented at #25547 (comment).
We can follow the approach of sklearn/torch/tensorRT gradle tests and not add very large ML dependencies to the setup.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see - so this was running on 3.7 and 3.9, just not 3.8 because of the difference in dependencies here -
Line 457 in 921bc7b
dependsOn(":sdks:python:test-suites:direct:py37:inferencePostCommitIT") |
Thanks for clarifying. I'm now +1 on removing this and manually triggering Python 3.7 postcommits, sorry for my confusion @riteshghorse
A couple of follow up questions for @AnandInguva and @tvalentyn :
- Is there any reason we only run the dataflow versions on 3.8? Since TensorRT is on Dataflow, we now need to run both the 3.7 and 3.8 postcommits to fully exercise our inference code base
- Is there any reason we're not running most of our inference postcommits on dataflow (as well as the direct runner)? That's probably where most of our usage is today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TensoRT tests run on Python 3.8 because of the container image provided by TensorRT folks contains 3.8. We need to have an automated process of building image from Dockerfile for Python 3.7, 3.9, 3.10 and then use that image for the tests in Dataflow.
- Initially, these tests are very light weight IT tests, so we just run on the DirectRunner. apart from that, I don't see any reason why we didn't run on Dataflow. Maybe adding these postcommit tests to Dataflow suite would increase the total time of Dataflow suite tests in the PostCommit suite.
Run Python 3.7 PostCommit |
Run Python Unit Tests |
Run Python 3.9 PostCommit |
(or you can merge) |
Run Python_Coverage PreCommit |
(all other checks have passed, they're just not statusing) |
All checks passed. Merging! |
* load model with weight * example * update test * update test * make create model fn optional * change tf to tensorflow * add readme and change urls * fix whitespace * add doc and changes.md * add tensorflow dependency * remove tf dependency
Adds support for loading tensorflow model from saved weights given a function to create the model.
Follow up to #25368, Closes #25366
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.