Skip to content

Conversation

k-w-w
Copy link
Contributor

@k-w-w k-w-w commented Apr 20, 2018

Looks like wide deep is the only official model that doesn't currently export savedmodel. Here are the changes to export it.

@k-w-w k-w-w requested review from a team and karmel as code owners April 20, 2018 21:41
--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.]}]'
```

Copy link
Contributor

Choose a reason for hiding this comment

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

This is great, thanks.


# Export the model
if flags.export_dir is not None:
wide_columns, deep_columns = build_model_columns()
Copy link
Contributor

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>"
)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@karmel karmel left a 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...

@k-w-w
Copy link
Contributor Author

k-w-w commented Apr 26, 2018

Will keep in mind in the future -- thanks!

@k-w-w k-w-w merged commit db77881 into master Apr 26, 2018
@k-w-w k-w-w deleted the export_wide_deep branch April 26, 2018 23:50
xueeinstein added a commit to xueeinstein/models that referenced this pull request May 2, 2018
* '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
  ...
@vicdxxx
Copy link

vicdxxx commented May 7, 2018

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
And if I delete "age", then raise NameError: name 'education_num' 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.
I use windows10 and tensorflow1.8 gpu edition.
Is this a bug or any thing I configure wrong?
Any suggestion is appreciated!

@k-w-w
Copy link
Contributor Author

k-w-w commented May 10, 2018

@vicdxxx I believe this is due to Windows treating single quotes as part of the input. Try running this:

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.]}]"

For future questions, please create a new issue or create a Stackoverflow question (with the tensorflow tag)

omegafragger pushed a commit to omegafragger/models that referenced this pull request May 15, 2018
@Menes00
Copy link

Menes00 commented Dec 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants