Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow tf.estimator.DNNLinearCombinedClassifier的计算精度/召回率_Tensorflow_Tensorflow Estimator - Fatal编程技术网

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")