LoginSignup
5

More than 5 years have passed since last update.

posted at

Keras バックエンドの変更

Keras バックエンドの変更

以前kerasのバックエンドのデフォルトがtheanoの時に書いた記事
を分離して残しておきます。

一度jupyter上などで、

import keras

を実行します。

keras.PNG

すると、C:\ユーザ\*ユーザーネーム*\.keras\ などの場所にkeras.jsonファイルが作られます。
これのファイルの中身の"theano"⇒"tensorflow"に書き換えます。(公式ページ参照)

<変更前>

keras.json
{
    "image_dim_ordering": "tf",
    "backend": "theano",
    "epsilon": 1e-07,
    "floatx": "float32"

<変更後>

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

これでバックエンドがtensorflowに切り替わります。

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
What you can do with signing up
5