python - TensorFlow:Compat 弃用警告

标签 python machine-learning tensorflow

注意:我的第一个问题在这里。请原谅缺乏细节或信息。如果需要,非常乐意澄清。

我在 Mac 上运行 TensorFlow 1.0.0,并且在使用 learn.Estimator 类时不断收到此警告

WARNING:tensorflow:From :25: calling fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with y is deprecated and will be removed after 2016-12-01. Instructions for updating: 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. Example conversion: est = Estimator(...) -> est = SKCompat(Estimator(...))

我已经尝试查找此类,但相关信息为零。完整代码贴在这里

https://github.com/austinmwhaley/DeepFarm/blob/master/prototype_1.ipynb

如果有任何人需要任何其他信息,请告诉我

最佳答案

您可以从 tensorflow.contrib.learn.python 导入 SKCompat:

from tensorflow.contrib.learn.python import SKCompat

然后用 SKCompat() 包装你的估计器,例如像这样:

classifier = SKCompat(tf.contrib.learn.LinearClassifier(args))

关于python - TensorFlow:Compat 弃用警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42451062/

相关文章:

python - 使用数据生成器时,Keras 自定义指标 self.validation_data 为 none

python - Keras FFT 层没有效果

tensorflow - 可以动态指定 Keras RepeatVector 重复吗?

python - 无法让我的 python 脚本替换\u 代码

python - 在 Python Bottle 应用程序中读取 cookie 文本值

python - ndb 是否可以与在 GAE 上不使用 ndb 而创建的实体一起使用?

python - 从 OneHotEncoder 获取对应的特征

python - countVectorizer Scikit-learn 中的特殊字符

python - Cloud-ml 无法使用tables_initializer 部署模型

python - Django - 解析 JSONP(带填充的 Json)