2017-03-17 42 views
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錯誤。

問題是我不知道如何擺脫警告(不是錯誤)。

回答

1

這部分Github tree正在積極開發中。一旦Estimator類被移動到版本爲r1.1的日程安排tf.core中,我預計此警告消息將消失。我發現Martin Wicke的2017 TensorFlow Dev Summit video對於高層次TensorFlow的未來計劃非常有用。