[問題] keras model問題
想請教一個簡單的model問題如下
def generator():
input = Input(shape=(100,))
y = Dense(300,activation = "relu")(input)
y = Dense(500,activation = "relu")(y)
y = Dense(784,activation = "relu")(y)
return Model(input,y)
以上就只是個簡單的model
問題來了:
Case I:(成功)
ori_model = generator()
y = ori_model.output
model = Model(ori_model.input, y)
Case II:(失敗)
generator()
y = generator().output
model = Model(generator().input, y)
===================================
我想知道Case II失敗的詳細原因
目前我只能說出個籠統的說法是,沒有先令一個變數的話(像caseI令成ori_model)
code並不知道要去找同一個model,而會去重複call generator()導致tf.graph接不上
但是這說法也只是我有了case I,II的比較才得出的
想求教詳細的原因,感謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 219.68.160.241
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1528480574.A.CF8.html
→
06/09 04:28,
7年前
, 1F
06/09 04:28, 1F
→
06/09 04:28,
7年前
, 2F
06/09 04:28, 2F
→
06/09 04:29,
7年前
, 3F
06/09 04:29, 3F
推
06/09 18:11,
7年前
, 4F
06/09 18:11, 4F
推
06/10 19:29,
7年前
, 5F
06/10 19:29, 5F
→
06/11 00:47,
7年前
, 6F
06/11 00:47, 6F
推
06/11 11:04,
7年前
, 7F
06/11 11:04, 7F
→
06/11 11:39,
7年前
, 8F
06/11 11:39, 8F
Python 近期熱門文章
PTT數位生活區 即時熱門文章