You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: official/wide_deep/README.md
+31
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,37 @@ Run TensorBoard to inspect the details about the graph and training progression.
47
47
tensorboard --logdir=/tmp/census_model
48
48
```
49
49
50
+
## Inference with SavedModel
51
+
You can export the model into Tensorflow [SavedModel](https://www.tensorflow.org/programmers_guide/saved_model) format by using the argument `--export_dir`:
After the model finishes training, use [`saved_model_cli`](https://www.tensorflow.org/programmers_guide/saved_model#cli_to_inspect_and_execute_savedmodel) to inspect and execute the SavedModel.
58
+
59
+
Try the following commands to inspect the SavedModel:
60
+
61
+
**Replace `${TIMESTAMP}` with the folder produced (e.g. 1524249124)**
62
+
```
63
+
# List possible tag_sets. Only one metagraph is saved, so there will be one option.
64
+
saved_model_cli show --dir /tmp/wide_deep_saved_model/${TIMESTAMP}/
65
+
66
+
# Show SignatureDefs for tag_set=serve. SignatureDefs define the outputs to show.
67
+
saved_model_cli show --dir /tmp/wide_deep_saved_model/${TIMESTAMP}/ \
68
+
--tag_set serve --all
69
+
```
70
+
71
+
### Inference
72
+
Let's use the model to predict the income group of two examples:
73
+
```
74
+
saved_model_cli run --dir /tmp/wide_deep_saved_model/${TIMESTAMP}/ \
0 commit comments