LoginSignup
0
0

More than 3 years have passed since last update.

tensorflowのstrategy.experimental_run_v2の使用する際の注意点

Posted at

tensorflowのstrategy.experimental_run_v2の使用する際の注意点

tensorflowには、分散学習用のAPIが用意されています。
tensorflowで分散学習する際に必ず使うstrategy.experimental_run_v2は、@tf.functionの中で宣言すべきようです。

    @tf.function
    def distributed_train_step(入力データなど):
            return  mirrored_strategy.experimental_run_v2(学習関数名, args=(入力データなど))

これだけなのですが、mirrored_strategy.experimental_run_v2で使用する学習関数のほうに@tf.funcionを宣言しておくとエラーが発生する場合があるようです。

0
0
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
0
0