2022年1月25日火曜日

TensorFlowでnot use cuDNN kernels警告メッセージ

 Amazon SageMaker Studio LabにTensor Flow2.6.2をインストールしてLSTMを使用して学習させてみたところ以下のエラーメッセージが表示

WARNING:tensorflow:Layer lstm will not use cuDNN kernels since it doesn't meet the criteria. It will use a generic GPU kernel as fallback when running on GPU.

WEBで翻訳させてみると「警告:tensorflow:Layer lstm_2は、基準を満たしていないため、cuDNNカーネルを使用しません。 GPUで実行する場合、フォールバックとして汎用GPUカーネルを使用します。」

基準は公式ドキュメントに記載があり以下のようです。

The requirements to use the cuDNN implementation are:

activation == tanh

recurrent_activation == sigmoid

recurrent_dropout == 0

unroll is False

use_bias is True

Inputs, if use masking, are strictly right-padded.

Eager execution is enabled in the outermost context.

    (修正前)

    m.add(LSTM(128, activation='relu',unroll=False,use_bias=True, input_shape=(nda_x_training.shape[1], nda_x_training.shape[2]))) 


    (修正後)

    m.add(LSTM(128, dropout=0.5,recurrent_dropout=0,activation='tanh',recurrent_activation='sigmoid',unroll=False,use_bias=True, input_shape=(nda_x_training.shape[1], nda_x_training.shape[2]))) 

 無事警告メッセージは表示しなくなったのでGPUが使用されたのかな。

0 件のコメント:

コメントを投稿