I am using tensorflow estimator to train a model and try to predict some value, then save the predicted result together with the input data, so that users can check the prediction result from one table to see if it's correct.
I've tried below code but feed_dict outputs None, I call predict using a dataset object.
class InsertPredictResultHook(tf.estimator.SessionRunHook):
def after_run(self, run_context, run_values):
print(run_context.original_args.fetches)
print(run_context.original_args.feed_dict)
print(run_values)
predictions = classifier.predict(input_fn=mydataset,
hooks = [InsertPredictResultHook()])
How can I get the input tensors together with predict result so that I can save these data for my users?
I am using tensorflow 2.0 alpha0