看板 Python 關於我們 聯絡資訊
如題 https://keras.io/examples/conv_filter_visualization/ 最近想將keras官網的example使用在自己訓練的模型上 但是會有error 自己測試後發現其中一段會有問題 如下 layer_dict = dict([(layer.name, layer) for layer in model.layers[1:]]) output_layer = layer_dict[layer_name] 這段會將model的名稱取出來 而官網的model的架構裡有input layer https://i.imgur.com/0mRWAsE.jpg 我的model裡並沒有這層 https://i.imgur.com/hnboAp0.jpg 因此它好像不會將我的卷積層放到layer_dict裡面 而這個example主要就是將卷積層的filter可視化 因此使用我的model執行時會有問題 想請問該怎麼將我的model裡在訓練時加入input layer的資料,亦或者怎麼改example的c ode達到我的目的 另外一個問題是這個example看起來是藉由gradient ascent的方法達到filter visualiza tion,那為什麼不能直接找出model裡的weight就好 希望各位大大能替我解答 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.113.156.98 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1585233063.A.B16.html
watashino: 乍看之下把1:改成0:就行了吧03/27 01:44
watashino: 第二個問題,因為filter你會看不出來在幹嘛03/27 01:44
watashino: 我說的filter就是指model weight03/27 01:44
感謝回覆 這個我試過了 會出現另一個error https://i.imgur.com/LXbzfY5.jpg 這個我就不清楚要怎麼解決了QQ 不太懂它的意思 ※ 編輯: zax5566x2 (140.113.156.98 臺灣), 03/27/2020 12:41:36