怎样从tensorflow的<generator object Estimator.predict at 0x7fb1ecefeaf0>中取数据
通过以下代码:
predictions = classifier.predict(
input_fn=lambda: predict_input_fn(args.data_dir,
params
))
print('predictions:',predictions)
得到输出的结果:
predictions: <generator object Estimator.predict at 0x000001D5AEEA0048>
这是个Estimator.predict形式,用如下方法,可以把数据打印出来
predictions = cls.predict(
input_fn=lambda: predict_input_fn(args.data_dir,
params
))
for p in predictions:
print('p:',p)