logo
Loading...

inputs and outputs of Module API / Functional API - Cupoy

Day 69 Module API 的作業,看了解答還是一頭霧水為什麼不能寫成model = ker...

ml100-4,ml100-4-d69

inputs and outputs of Module API / Functional API

2020/06/14 03:18 PM
機器學習新手論壇
Shih Cheng Chen
觀看數:0
回答數:1
收藏數:0
ml100-4
ml100-4-d69

Day 69 Module API 的作業,看了解答還是一頭霧水

為什麼不能寫成

model = keras.Model(inputs = main_input, outputs = main_output, name = "test_model")


錯誤如下

ValueError: Graph disconnected: cannot obtain value for tensor Tensor("news_in:0", shape=(None, 5), dtype=float32) at layer "news_in". The following previous layers were accessed without issue: ['main_input', 'embedding_1', 'lstm_1']


程式和build error如下:

https://github.com/chencgn1982/4th-ML100Days/blob/master/homework/Day_69_keras_Module_API_HW.ipynb