简体   繁体   中英

Tensorflow - tf.Layers : Error with the function .fit

I'm running the example cnn_mnist given on github that is using layers module. I can run the program but a Warning appears telling me that one of the function is deprecated. I couldn't find which new function needs to be used.

WARNING:tensorflow:From <ipython-input-14-ee49e8b76469>:25: calling BaseEstimator.fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with batch_size 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(...))

It should be sufficient to modify that script like this:

# Create the Estimator
mnist_classifier = learn.SKCompat(learn.Estimator(
  model_fn=cnn_model_fn, model_dir="/tmp/mnist_convnet_model"))

However, please open a Github issue to update that sample so it doesn't mislead anyone else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM