TypeError:softmax()が予期しないキーワード引数を取得しました 'axis' Activation( 'softmax')が存在しません



Typeerror Softmax Got An Unexpected Keyword Argumentaxisactivation Does Not Exist



TypeError:softmax()が予期しないキーワード引数 'axis'を取得しました
この問題は、kerasバージョンが高く、テンソルフローに問題があるために発生します。
エラーメッセージ
解決
1. kerasバージョンをダウングレードし、指定されたバージョンをアンインストールして再インストールしますpip install keras == 2.1
2.エラーディレクトリを見つけ、3231についての行を見つけます

def softmax(x, axis=-1): '''Softmax of a tensor. # Arguments x: A tensor or variable. axis: The dimension softmax would be performed on. The default is -1 which indicates the last dimension. # Returns A tensor. ''' return tf.nn.softmax(x,axis=axis)

に変更されました



def softmax(x, axis=-1): '''Softmax of a tensor. # Arguments x: A tensor or variable. axis: The dimension softmax would be performed on. The default is -1 which indicates the last dimension. # Returns A tensor. ''' return tf.nn.softmax(x,dim=axis)