LoginSignup
zunda_pixel
@zunda_pixel (zunda)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

TensorflowのKerasとKerasの違いはありますか?

TensorflowのKerasとKerasの違いはありますか?
上のコードとしたのコードでは違いはありますか?

from tensorflow.config.experimental import list_physical_devices
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, LSTM

physical_devices = list_physical_devices('GPU')
from tensorflow.config.experimental import list_physical_devices
from keras.models import Sequential
from keras.layers import Dense, LSTM

physical_devices = list_physical_devices('GPU')
1

1Answer

Kerasは以前独自で開発され、TF以外にもTheanoやCNTKなど、複数の深層学習フレームワークバックエンドとして選択できるようになっていましたが、近年ではTheanoとCNTKが使われなくなり、TFがメインになってきました。そのため、KerasがどんどんTFのサポートを強化し、結局TFの一部として導入されました。独自バージョンはまだサポートされているんですが、基本的にTFのKerasを利用することがおすすめされています、特にTF2を使って開発しているなら。Kerasの作者、CholletさんがツイートでもTFのバージョンを使うことをおすすめしています。https://twitter.com/fchollet/status/1174018651449544704?s=19

例外的な話なんですが、古いTF(1.x系の古い方とか)のソースコードを扱っている場合はたまにKerasの独自バージョンを使う必要はあるんですが、新規で開発する時はTF Kerasを使うのがベストだと思っています。

1

Comments

  1. @zunda_pixel

    Questioner
    解説ありがとうございます。
    tensorflow.kerasを使っていこうと思います。

Your answer might help someone💌