使用estimator.export_saved_model('saved_model', serving_input_receiver_fn)
导出模型之后,再使用tf.contrib.predictor.from_saved_model
加载模型报错:ValueError: The name '' looks like an (invalid) Operation name, not a Tensor. Tensor names must be of the form "<op_name>:<output_index>".
报错详细内容:
INFO:tensorflow:Restoring parameters from saved_model/1577241037/variables/variables
Traceback (most recent call last):
File "serve.py", line 241, in <module>
predict_fn = tf.contrib.predictor.from_saved_model(latest)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/predictor/predictor_factories.py", line 153, in from_saved_model
config=config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/predictor/saved_model_predictor.py", line 162, in __init__
for k, v in input_names.items()}
File "/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/predictor/saved_model_predictor.py", line 162, in <dictcomp>
for k, v in input_names.items()}
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3666, in get_tensor_by_name
return self.as_graph_element(name, allow_tensor=Tr