Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING:tensorflow - initialize_all_variables (from tensorflow.python.ops.variables) is deprecated

While initializaing tensorflow

init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)

get below warning

WARNING:tensorflow:From D:/Projects/Python/DLPractice/boston_housing.py:75 in <module>.: 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.

How to remove the warning and use updated code?

like image 661
gmsi Avatar asked Jan 31 '17 16:01

gmsi


1 Answers

Solution is to use the updated method global_variables_initializer() instead of initialize_all_variables

init = tf.global_variables_initializer()
like image 149
gmsi Avatar answered Nov 15 '22 08:11

gmsi