2017-05-07 23 views
0

我正在運行示例cnn_mnist給出github使用圖層模塊。 我可以運行該程序,但出現一個警告,告訴我該功能之一已被棄用。 我找不到需要使用哪個新功能。Tensorflow - tf.Layers:錯誤的功能.fit

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(...))

回答

1

這應該足以修改劇本是這樣的:

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

然而,請打開Github上的問題,以更新樣本,因此不會誤導任何人。