logo
Loading...

D68 建立CNN model 跳出棄用之問題 - Cupoy

老師你好 : d68這邊有2個問題不懂,想請教問題1.作業中執行到圖中這段時會跳出 tensorfl...

ml100-2,ml100-2-d68

D68 建立CNN model 跳出棄用之問題

2019/07/05 06:18 PM
機器學習新手論壇
Edison Chou
觀看數:0
回答數:3
收藏數:0
ml100-2
ml100-2-d68

老師你好 : 

d68這邊有2個問題不懂,想請教


問題1.

作業中執行到圖中這段時會跳出 tensorflow 某個function被棄用與未來即將棄用的問題(不知道對結果有無影響?)

但現在用的套件是keras去接tensorflow ,我要如何修改keras中的參數或哪一段程式碼才能不跳出這些警告呢?


WARNING: Logging before flag parsing goes to stderr.
W0706 01:56:33.773051 18028 deprecation_
wrapper.py:119] From C:\Users\user\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:71: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0706 01:56:33.787030 18028 deprecation_
wrapper.py:119] From C:\Users\user\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:514: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0706 01:56:33.789029 18028 deprecation_
wrapper.py:119] From C:\Users\user\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:4076: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0706 01:56:33.815034 18028 deprecation_
wrapper.py:119] From C:\Users\user\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:130: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

W0706 01:56:33.820019 18028
deprecation.py:506] From C:\Users\user\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:3363: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.


圖1.

註 : 我的keras、tensorflow版本如下

問題2. 

針對圖1中的程式碼 Conv2D、Flatten、Dropout、Dense這些function的意義可否多加說明呢?

以及程式碼中 哪幾行 分別對應到 輸入層、隱藏層、輸出層 (範例中實在看不出來共有幾層..)


範例1.

model = Sequential( [   Dense(32, input_shape=(784,)),     Activation('relu') ])

範例2.

model = Sequential() 

model.add(Dense(32, input_dim=784)) 

model.add(Activation('relu'))


範例1.與範例2.的層數算是一樣嗎?  (輸入層、隱藏層、輸出層分別為幾層呢)


為何圖1中的寫法為CNN呢?