@@ -181,8 +181,16 @@ def from_checkpoint(model_path, input_names, output_names):
181
181
def _from_saved_model_v1 (sess , model_path , input_names , output_names , tag , signatures ):
182
182
"""Load tensorflow graph from saved_model."""
183
183
184
+ wrn_no_tag = "'--tag' not specified for saved_model. Using --tag serve"
185
+ wrn_empty_tag = "'--tag' value is empty string. Using tag =[[]]"
186
+
184
187
if tag is None :
185
188
tag = [tf .saved_model .tag_constants .SERVING ]
189
+ logger .warning (wrn_no_tag )
190
+
191
+ if tag == '' :
192
+ tag = [[]]
193
+ logger .warning (wrn_empty_tag )
186
194
187
195
if not isinstance (tag , list ):
188
196
tag = [tag ]
@@ -218,7 +226,8 @@ def _from_saved_model_v1(sess, model_path, input_names, output_names, tag, signa
218
226
def _from_saved_model_v2 (model_path , input_names , output_names , tag , signature_def , concrete_function_index ):
219
227
"""Load tensorflow graph from saved_model."""
220
228
221
- wrn_no_tag = "'--tag' not specified for saved_model. Using empty tag [[]]"
229
+ wrn_no_tag = "'--tag' not specified for saved_model. Using --tag serve"
230
+ wrn_empty_tag = "'--tag' value is empty string. Using tag =[[]]"
222
231
wrn_sig_1 = "'--signature_def' not specified, using first signature: %s"
223
232
err_many_sig = "Cannot load multiple signature defs in TF2.x: %s"
224
233
err_no_call = "Model doesn't contain usable concrete functions under __call__. Try --signature-def instead."
@@ -227,8 +236,13 @@ def _from_saved_model_v2(model_path, input_names, output_names, tag, signature_d
227
236
err_sig_nomatch = "Specified signature not in model %s"
228
237
229
238
if tag is None :
230
- tag = [[] ]
239
+ tag = ['serve' ]
231
240
logger .warning (wrn_no_tag )
241
+
242
+ if tag == '' :
243
+ tag = [[]]
244
+ logger .warning (wrn_empty_tag )
245
+
232
246
utils .make_sure (len (signature_def ) < 2 , err_many_sig , str (signature_def ))
233
247
imported = tf .saved_model .load (model_path , tags = tag ) # pylint: disable=no-value-for-parameter
234
248
0 commit comments