嘿,我有一個似乎很常見的問題,但我確信我所做的應該可行,因為它非常簡單。
它與 Keras Concatenate 層有關:
Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 128, 256, 192, 1), dtype=tf.float32, name='input_1'), name='input_1', description="created by layer 'input_1'") at layer "tf.concat". The following previous layers were accessed without issue: []
我基本上是在嘗試連接 2 個輸入,如下所示:
in_layer1 = Input((sizes1[1], sizes1[2], sizes1[3], 1)) # (slices, x, y, channel=1)
in_layer2 = Input((sizes2[1], sizes2[2], sizes2[3], 1)) # (slices, x, y, channel=1)
in_layer = Concatenate(axis=1)([in_layer1, in_layer2][:]) # combine the two inputs
當我實體化模型時會發生問題:
Model(inputs=[in_layer], outputs=[out_layer])
這似乎是 tf2.2 之前的問題,我使用的是 2.4,所以不確定為什么會這樣:https : //github.com/tensorflow/tensorflow/issues/32023
任何幫助或資源將不勝感激。我檢查了檔案,我認為我沒有做錯,但顯然有問題。
uj5u.com熱心網友回復:
正如@Dr.Snoopy 提到的, in_layer 實際上不是輸入層。相反,它應該是 Model(inputs=[in_layer1, in_layer2],outputs=[out_layer])
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/346309.html
上一篇:Tensorflow資料集-什么是pandasdataframe.info等價物?
下一篇:如何一次選擇一個單選按鈕
