初始化张量流
init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)
低于警告
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.
如何删除警告并使用更新的代码?
答案 0 :(得分:11)
解决方案是使用更新后的方法global_variables_initializer()
代替initialize_all_variables
init = tf.global_variables_initializer()