Hezi-Resheff/Oreilly-Learning-TensorFlow

Running examples gives a lot of deprecation warnings

jimhigson opened this issue · 2 comments

Running python 3.6, the MNIST example from chapter 2 gives more warning than actual output:

(anns) jimhigson@budapest ~/d/A/Learning Tensorflow Book> python Oreilly-Learning-TensorFlow/02__up_and_running/softmax.py
WARNING:tensorflow:From Oreilly-Learning-TensorFlow/02__up_and_running/softmax.py:10: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
WARNING:tensorflow:From /Users/jimhigson/dev/ANNs/Learning Tensorflow Book/envs/anns/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Please write your own downloading logic.
WARNING:tensorflow:From /Users/jimhigson/dev/ANNs/Learning Tensorflow Book/envs/anns/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:262: extract_images (from tensorflow.contrib.learn.python.learn.datasets.mnist)is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting /tmp/data/train-images-idx3-ubyte.gz
WARNING:tensorflow:From /Users/jimhigson/dev/ANNs/Learning Tensorflow Book/envs/anns/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:267: extract_labels (from tensorflow.contrib.learn.python.learn.datasets.mnist)is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting /tmp/data/train-labels-idx1-ubyte.gz
WARNING:tensorflow:From /Users/jimhigson/dev/ANNs/Learning Tensorflow Book/envs/anns/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:110: dense_to_one_hot (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.one_hot on tensors.
Extracting /tmp/data/t10k-images-idx3-ubyte.gz
Extracting /tmp/data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /Users/jimhigson/dev/ANNs/Learning Tensorflow Book/envs/anns/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
WARNING:tensorflow:From Oreilly-Learning-TensorFlow/02__up_and_running/softmax.py:19: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See `tf.nn.softmax_cross_entropy_with_logits_v2`.

2018-10-07 13:09:56.778201: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Accuracy: 90.97%

It would be good if there were an updated version in the git repo, explaining what the differences and why the old ways were deprecated.

First, they can specify the version of TensorFlow used in these examples

The book uses TF v1.0
In most cases it is pretty easy to find the changes in the TF docs, but we will use the updated version in the next version of the book.