Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0da4acd

Browse files
kirilgtensorflower-gardener
authored andcommitted
Add a classification signature to the test saved_model_half_plus_two_model.
Test using this classification signature using the Predict API. Change: 149769547
1 parent b92f7aa commit 0da4acd

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed
Binary file not shown.

tensorflow/cc/saved_model/testdata/half_plus_two_pbtxt/00000123/saved_model.pbtxt

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ meta_graphs {
447447
}
448448
}
449449
tags: "serve"
450-
tensorflow_version: "0.12.head"
450+
tensorflow_version: "1.0.0"
451451
tensorflow_git_version: "unknown"
452452
}
453453
graph_def {
@@ -1714,7 +1714,7 @@ meta_graphs {
17141714
dtype: DT_STRING
17151715
tensor_shape {
17161716
}
1717-
string_val: "_temp_aeab824a1fc94305a10a2504f5995de2/part"
1717+
string_val: "_temp_d286b725003942fd8bac94b6c67e7c0c/part"
17181718
}
17191719
}
17201720
}
@@ -2503,6 +2503,42 @@ meta_graphs {
25032503
}
25042504
}
25052505
}
2506+
signature_def {
2507+
key: "classify_x2_to_y3"
2508+
value {
2509+
inputs {
2510+
key: "inputs"
2511+
value {
2512+
name: "x2:0"
2513+
dtype: DT_FLOAT
2514+
tensor_shape {
2515+
dim {
2516+
size: -1
2517+
}
2518+
dim {
2519+
size: 1
2520+
}
2521+
}
2522+
}
2523+
}
2524+
outputs {
2525+
key: "scores"
2526+
value {
2527+
name: "y3:0"
2528+
dtype: DT_FLOAT
2529+
tensor_shape {
2530+
dim {
2531+
size: -1
2532+
}
2533+
dim {
2534+
size: 1
2535+
}
2536+
}
2537+
}
2538+
}
2539+
method_name: "tensorflow/serving/classify"
2540+
}
2541+
}
25062542
signature_def {
25072543
key: "classify_x_to_y"
25082544
value {

tensorflow/examples/saved_model/saved_model_half_plus_two.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ def _generate_saved_model_for_half_plus_two(export_dir, as_text=False):
181181
_build_regression_signature(x2, y3),
182182
"classify_x_to_y":
183183
_build_classification_signature(serialized_tf_example, y),
184+
"classify_x2_to_y3":
185+
_build_classification_signature(x2, y3),
184186
tf.saved_model.signature_constants.
185187
DEFAULT_SERVING_SIGNATURE_DEF_KEY:
186188
predict_signature_def

0 commit comments

Comments
 (0)