【问题标题】:tf Iris - how to avoid warning message on deprecated estimatortf Iris - 如何避免在已弃用的估计器上出现警告消息
【发布时间】:2017-03-10 07:29:10
【问题描述】:

刚开始使用 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 库 (anaconda 3.5) 中的问题?
  • 如何避免?

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

【问题讨论】:

    标签: tensorflow deprecated iris-recognition


    【解决方案1】:

    TensorFlow 库 tf.contrib.learn.estimator.py 似乎正在生成此警告。此警告似乎是在 2016 年 12 月 1 日添加的,当时决定放弃对x=y= 的支持,转而支持input_fn= 参数到BaseEstimator。根据 Martin Wicke 在 TensorFlow Dev Summit 期间制作的 cmets,tf.contrib 中的所有过程在移入 TensorFlow Core 之前都可能发生变化。他还表示,SKEstimator 将支持之前的接口。 Google 团队在使教程保持最新方面做得很好。既定计划是在未来几个月内将 Estimator 迁移到 TensorFlow Core。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      相关资源
      最近更新 更多