tf Iris - 如何避免弃用估算器上的警告消息

时间:2017-03-10 07:29:11

标签: tensorflow deprecated iris-recognition

刚刚开始tf。在运行Iris示例时,我遇到了这个问题 警告:

WARNING:tensorflow:From <...>/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py:348 
in predict.: calling BaseEstimator.predict (from tensorflow.contrib.learn.python.learn.estimators.estimator) with as_iterable is deprecated and will be removed after 2016-12-01.

"Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn."

我在2017年2月安装了tf(在API 1.0发布之后)。所以,我不知道为什么会这样 警告正在弹出。

但是代码运行正常。

我想知道:

  • 是tf库中的问题,还是在python base(anaconda 3.5)?
  • 如何避免呢?

即使它现在只是一个警告,它可能会在以后产生难以发现的问题,并且希望尽早解决它,当时我还在学习曲线上。 感谢。

1 个答案:

答案 0 :(得分:0)

看起来这个警告是由TensorFlow库tf.contrib.learn.estimator.py生成的。当决定放弃对x=y=的支持以支持input_fn=参数BaseEstimator时,此警告似乎已在2016-12-01添加。根据Martin Wicke在TensorFlow Dev Summit期间提出的意见,tf.contrib中的所有程序都会发生变化,直到它们被移入TensorFlow Core。他还表示,之前的界面将得到SKEstimator的支持。 Google团队在完成教程方面做得非常出色。所述计划是在未来几个月内将Estimators移至TensorFlow Core。

相关问题