1. 程式人生 > >TensorFlow學習過程記錄 -- 問題解決

TensorFlow學習過程記錄 -- 問題解決

在執行過程中,輸出總是會產生兩行警告資訊:
WARNING:tensorflow:From D:\python35\lib\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.
這兩行資訊雖然不影響程式執行輸出,但是看著總覺得不爽像這樣:
這裡寫圖片描述

解決:

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.
警告資訊說,initialize_all_variables()方法在2017年3月2日被移除了,應該使用新的global_variables_initializer。因此,將程式碼中的initialize_all_variables()更換:
這裡寫圖片描述


再次執行,程式正常:
這裡寫圖片描述