3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Keras バックエンドの変更

Posted at

#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に切り替わります。

3
5
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
3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?