以下の内容はhttps://paper.hatenadiary.jp/entry/2017/02/09/232108より取得しました。


エラー解決:Exception: The shape of the input to "Flatten" is not fully defined

エラー内容

kerasを用いている時に

Exception: The shape of the input to "Flatten" is not fully defined ...

のエラー

解決方法

モデルの定義が正しい(レイヤー間の次元数の数が正しい)のに失敗する時は

vim ~/.keras/keras.jsonとして

{
    "image_dim_ordering": "tf",
    "epsilon": 1e-07,
    "floatx": "float32",
    "backend": "tensorflow"
}

の記述をチェック。

  • "backend": "tensorflow"なら"image_dim_ordering": "tf"
  • "backend": "theano"なら"image_dim_ordering": "th"

に変更する。記述しないと"image_dim_ordering": “tf”`に指定されて、この時に theanoを使用するとエラーになる。




以上の内容はhttps://paper.hatenadiary.jp/entry/2017/02/09/232108より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14