-
Notifications
You must be signed in to change notification settings - Fork 45.5k
Add export savedmodel to wide_deep #4041
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
Conversation
--tag_set serve --signature_def="predict" \ | ||
--input_examples='examples=[{"age":[46.], "education_num":[10.], "capital_gain":[7688.], "capital_loss":[0.], "hours_per_week":[38.]}, {"age":[24.], "education_num":[13.], "capital_gain":[0.], "capital_loss":[0.], "hours_per_week":[50.]}]' | ||
``` | ||
|
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 great, thanks.
official/wide_deep/wide_deep.py
Outdated
|
||
# Export the model | ||
if flags.export_dir is not None: | ||
wide_columns, deep_columns = build_model_columns() |
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.
Maybe separate out into a separate function to keep the main a little cleaner? Then just call the fn if export_dir is not None.
"the model will be exported to this directory at the end of " | ||
"training. See the README for more details and relevant links.", | ||
metavar="<ED>" | ||
) |
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 provide a default directory if user provides none? Not sure if this feature is used frequently by users. If so, I think a default dir may be good.
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.
Considering that the functionality of SavedModel is currently limited to serving, I don't think this feature is frequently used.
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.
Don't forget to ping me when all comments are addressed, or I never know to look again...
Will keep in mind in the future -- thanks! |
* 'master' of https://github.com/tensorflow/models: (404 commits) official/mnist: Updates with the release of TensorFlow 1.8. Internal changes to slim and object detection (tensorflow#4100) catch cpuinfo ImportError (tensorflow#4138) [samples/core/get_starter/eager]: Update with API simplifications in 1.8 Add vincentvanhoucke as owner for research/marco Add marco subdirectory to README.md Create request.json Create jpeg2json.py Fix width / height. Create README.md Add new import paths to mnist_tpu.py (tensorflow#4133) fix model call (tensorflow#4132) Remove useless fields in resnet_model (tensorflow#4110) official/mnist: Add input_shape parameter to initial layer (tensorflow#4104) (tensorflow#4118) Increase minimum TF version for DEFINE_enum and rename variable mappings for change to RNN variable names. (tensorflow#4123) fix import errors Minor update the resnet runloop. (tensorflow#4113) Two new plot-generating scripts and changes in support of the ICLR poster. (tensorflow#4092) Add export savedmodel to wide_deep (tensorflow#4041) Fix 2 typos ...
Hi, guys! I have tried this command several times: saved_model_cli run --dir /My Directory/ --tag_set serve --signature_def="predict" --input_examples='examples=[{"age":[46.], "education_num":[10.], "capital_gain":[7688.], "capital_loss":[0.], "hours_per_week":[38.]}, {"age":[24.], "education_num":[13.], "capital_gain":[0.], "capital_loss":[0.], "hours_per_week":[50.]}]' But it is always wrong with an error NameError: name 'age' is not defined It seems none of keys make sense. and I read the source code, which do call build_model_columns() function and tf.feature_column.numeric_column('age') and so on. |
@vicdxxx I believe this is due to Windows treating single quotes as part of the input. Try running this:
For future questions, please create a new issue or create a Stackoverflow question (with the tensorflow tag) |
Hello, I need to install tensorflow-gpu 1.8 for a project. I have a Geforce GTX 1650ti graphics card. Can you show me a way to do this? @vicdxxx |
Looks like wide deep is the only official model that doesn't currently export savedmodel. Here are the changes to export it.