1
当制作DNN回归和Undeprecating tensorflow
print(list(estimator.predict({"p": np.array([[0.,0.],[1.,0.],[0.,1.],[1.,1.]])})))
预测值,这是控制台输出:
WARNING:tensorflow:From "...\tensorflow\contrib\learn\python\learn\estimators\dnn.py":692: calling BaseEstimator.predict (from tensorflow.contrib.learn.python.learn.estimators.estimator) with x 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(...))
所以我把头成dnn.py
692线,这就是我找到
preds = super(DNNRegressor, self).predict(
x=x,
input_fn=input_fn,
batch_size=batch_size,
outputs=[key],
as_iterable=as_iterable)
所以下面从错误的建议,并假设super(DNNRegressor, self)
是Estimator
我只是做了
preds = estimator.SKCompat(super(DNNRegressor, self)).predict(...)
但这样做,我得到
TypeError: predict() got an unexpected keyword argument 'input_fn'
,看起来像它不是一个tensorflow错误。
问题是我不知道如何摆脱警告(不是错误)。