1. 程式人生 > >報錯 initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed

報錯 initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed

WARNING:tensorflow:From /home/hndx532/anaconda3/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py:118: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use `tf.global_variables_initializer` instead.

解決:

#將init = tf.initialize_all_variables() # old api 改為
init = tf.global_variables_initializer() #new api