![](/img/trans.png)
[英]Keras 'InputLayer object has no attribute 'inbound_nodes' when converting to CoreML
[英]AttributeError: 'InputLayer' object has no attribute 'inbound_nodes'
運行此腳本時出現以下錯誤: https : //pastebin.com/X7146Ury 。
AttributeError: 'InputLayer' object has no attribute 'inbound_nodes'
在最新版本的_inbound_nodes
,它被重命名為_inbound_nodes
(注意添加的下划線)。 您使用的 coremltools 版本似乎與該 Keras 版本不兼容。
但是,GitHub 上的最新版本似乎確實使用了新的_inbound_nodes
名稱。 我建議你安裝它,使用:
pip install -U git+https://github.com/apple/coremltools.git
我試圖編寫一個自定義層,問題是我正在子類化的類,而不是from tensorflow.keras.layers import Layer
,我使用
from Keras import layers
class layerName(layers.Layer):
#impelementation
它奏效了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.