-
Notifications
You must be signed in to change notification settings - Fork 756
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
Example of TF Serving with GPU #154
Conversation
/retest |
gpu_serving/README.md
Outdated
## Deploy serving component | ||
|
||
``` | ||
ks init ks-app |
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.
@texasmichelle
Should we just tell people to refer to the Getting Started guide to create the app and then just tell them to CD to the directory containing their application?
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.
Done
gpu_serving/README.md
Outdated
``` | ||
wget http://download.tensorflow.org/models/object_detection/faster_rcnn_nas_coco_2018_01_28.tar.gz | ||
tar -xzf faster_rcnn_nas_coco_2018_01_28.tar.gz | ||
gsutil cp faster_rcnn_nas_coco_2018_01_28/saved_model/saved_model.pb gs://YOUR_BUCKET/YOUR_MODEL/1/ |
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.
Should we publish the model to gs://kubeflow-examples-data/
so people can just serve it from there?
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.
pushed
model1: { | ||
cloud: 'gcp', | ||
deployHttpProxy: true, | ||
gcpCredentialSecretName: 'kai-sa', |
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.
Why are you using the GCP secret kai-sa? I believe the GKE deploy secrets will create the secret user-sa does that work?
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.
I was reading model in my bucket. user-sa should work.
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.
Can you change the default parameters to be parameters that will work for users here and below.
gpu_serving/predict.py
Outdated
@@ -0,0 +1,46 @@ | |||
import argparse |
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.
This is a CLI for the example?
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.
Yes, see README: python predict.py --url=YOUR_KF_HOST/models/coco
@@ -0,0 +1,2 @@ | |||
{ |
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.
Lets not check in your environment.
I'd suggest adding it to the .gitignore file so it doesn't get checked in.
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.
Done.
But it's still in app.yaml. Not sure if there is a good way to avoid that.
This is great. @texasmichelle Any overall guidance about how we should be structuring the examples? |
@jlewi Thanks, PTAL |
It looks like someone started checking in an object detection model here Is this the same example? Should we move it into that directory? |
Filed #185 |
See comments on #185 |
The consensus on #185 seems to be to having a single object_detection model. Lunkai do you want to move these files into that directory? Maybe you replace what's in object_detection/tf-serving? And maybe combine the READMEs? @texasmichelle does that work for you? |
I think it's a little awkward to move this into object_detection now as that example currently uses many yaml and doesn't have a ks-app. |
Why can't you make it a subdirectory of object_detection? e.g.
|
Do we even need the YAML file that's currently in object_detection/tf-serving? What is that file doing that your example isn't? |
moved. I put the ks-app at the object_detection as I think other yaml files will be moved to the app too. |
|
||
## Setup | ||
|
||
If you followed previous steps to train the model, skip to deploy [section](#deploy-serving-component). |
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.
The setup steps feel out of place here, since the title is Serving an object detection model with GPU. Could you integrate them with the other markdown files in this example?
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.
I think some users might only interested in trying out serving. This provides the steps to do if they skip the training part. And the first line is tell them to skip this if they've done training.
Does it make sense?
What is |
removed inputs.json. That's missed when moving. |
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.
Reviewable status: 0 of 17 files reviewed, 5 unresolved discussions (waiting on @jlewi, @lluunn, @texasmichelle, and @cwbeitel)
gpu_serving/predict.py, line 1 at r4 (raw file):
Previously, lluunn (Lun-Kai Hsu) wrote…
Yes, see README:
python predict.py --url=YOUR_KF_HOST/models/coco
Can you add a doc string for the module explaining that.y
gpu_serving/README.md, line 25 at r4 (raw file):
Previously, lluunn (Lun-Kai Hsu) wrote…
Done
Why don't they use they ksonnet app in the examples directory and just create a new enviornment?
Took another look. I think only significant comment I have is whether we should be telling users to use the ksonnet app provided in the example and just adding and environment to it rather than creating a new app. My thinking is that based on other examples we will want to provide the app as an easy way of making a whole bunch of resources that are part of the example available to users. |
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.
Reviewable status: 0 of 17 files reviewed, 5 unresolved discussions (waiting on @jlewi, @lluunn, @texasmichelle, and @cwbeitel)
gpu_serving/predict.py, line 1 at r4 (raw file):
Previously, jlewi (Jeremy Lewi) wrote…
Can you add a doc string for the module explaining that.y
done
gpu_serving/README.md, line 25 at r4 (raw file):
Previously, jlewi (Jeremy Lewi) wrote…
Why don't they use they ksonnet app in the examples directory and just create a new enviornment?
Modified the instruction to cd to app without ks init.
Modify the instruction to tell user to cd to that ks app instead of ks init. PTAL, thanks |
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.
Reviewable status: 0 of 17 files reviewed, 2 unresolved discussions (waiting on @jlewi, @texasmichelle, and @cwbeitel)
gpu_serving/object-detection-app/components/params.libsonnet, line 9 at r4 (raw file):
Previously, jlewi (Jeremy Lewi) wrote…
Can you change the default parameters to be parameters that will work for users here and below.
The default secret is "user-gcp-sa"
I had one minor comment abou the default value for the GCP secret name but other than that this LGTM. |
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.
Reviewable status: 0 of 17 files reviewed, 2 unresolved discussions (waiting on @jlewi, @texasmichelle, and @cwbeitel)
gpu_serving/object-detection-app/components/params.libsonnet, line 9 at r4 (raw file):
Previously, jlewi (Jeremy Lewi) wrote…
The default secret is "user-gcp-sa"
Done.
Done. Thanks |
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.
Reviewable status: 0 of 17 files reviewed, 1 unresolved discussion (waiting on @texasmichelle and @cwbeitel)
/lgtm @texasmichelle I know your busy with NEXT do you want @lluunn to wait until you can take another look? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlewi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#145
python predict.py --utl=XX
should work.Only files need review: README.md and predict.py
visualization_utils.py and standard_fields.py are copied from
https://github.com/tensorflow/models/blob/master/research/object_detection/utils/visualization_utils.py
Next PR should move the python logic into a webapp and deploy it.
This change is