Tensorflow tf.estimator.DNNLinearCombinedClassifier的计算精度/召回率
我刚刚更新了Tensorflow tf.estimator.DNNLinearCombinedClassifier的计算精度/召回率,tensorflow,tensorflow-estimator,Tensorflow,Tensorflow Estimator,我刚刚更新了DNNLinearCombinedClassifier以使用tf.estimator,它只接受SessionRunHook而不是ValidationMonitor,我一直在使用描述的代码来计算精度/召回率,因为评估者不打印这两个指标。但是,我无法找到一种方法来使用tf.estimator.estimator所需的SessionRunHook实现同样的事情 我找到了一篇相关的帖子,但在代码中,如果指定了度量(来自tensorflow/contrib/learn/python/learn
DNNLinearCombinedClassifier
以使用tf.estimator
,它只接受SessionRunHook
而不是ValidationMonitor
,我一直在使用描述的代码来计算精度/召回率,因为评估者不打印这两个指标。但是,我无法找到一种方法来使用tf.estimator.estimator
所需的SessionRunHook
实现同样的事情
我找到了一篇相关的帖子,但在代码中,如果指定了度量(来自tensorflow/contrib/learn/python/learn/monitors.py),那么似乎特别禁止使用ValidationMonitor
:
我使用的是tensorflow 1.5.0
对如何实现这一点有什么建议吗?对于我来说,用输入来实例化验证监视器,而不是显式地传递x_val和y_val,可以消除相同的错误。也可以使用tensorflow 1.5。
if isinstance(self._estimator, core_estimator.Estimator):
if any((x is not None for x in
[self.x, self.y, self.batch_size, self.metrics])):
raise ValueError(
"tf.estimator.Estimator does not support following "
"arguments: x, y, batch_size, metrics. Should set as `None` "
"in ValidationMonitor")