Search code examples
pythontensorflowskflow

WARNING:tensorflow:TensorFlowDNNRegressor class is deprecated. Please consider using DNNRegressor as an alternative


Yesterday, I had updated Tensorflow to version 0.9 from 0.8. After which, I am observing the following warning with my Skflow models. Could anyone please let me know what this means? Is there a way to fix it? Are there alternate methods to model DNN Regressor with Skflow?

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py:1197: VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future result_shape.insert(dim, 1)

WARNING:tensorflow:TensorFlowDNNRegressor class is deprecated. Please consider using DNNRegressor as an alternative.


Solution

  • This is just a Warning so your model will train fine. Skflow (or TFLearn same thing) advises you to use skflow.DNNRegressor instead of skflow.TensorFlowDNNRegressor.

    Here are the arguments of DNNRegressor and the doc:

    tf.contrib.learn.DNNClassifier.__init__(
      hidden_units,
      feature_columns=None,
      model_dir=None,
      n_classes=2,
      weight_column_name=None,
      optimizer=None,
      activation_fn=relu,
      dropout=None,
      config=None)
    

    However, according to this previous post, the new function does not work yet so I will advise you to stay with the old one for now !