LoginSignup
5
1

More than 5 years have passed since last update.

KerasのContainerが名前を変えていた件

Posted at

Kerasで急に知っているレイヤーが使えなくなる

ある日最新バージョンのKerasでモデルを作っていたら突然

cannot import name 'Container'

と言われてしまいました。
複数のレイヤーの重みをまとめて1つの塊として共有したいときに便利なので時折利用するのですが
https://github.com/keras-team/keras/pull/10023
によると Network という名称に変わったようです。

importも

from keras.engine.network import Network

とするみたいです。使い方はContainerとほぼ同様で今の所問題なく使えていますが、急に変えられるとググっても答え出てこないので結構悩みます :sweat:

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1