1
Kerasを初めて使用しています。 Keras(バックエンド:Tensorflow)でimdbの例を再現したいので、モデルをコンパイルしようとするとエラーが発生します。モデルをコンパイルするときのKeras - ValueError
from keras import models
from keras import layers
model = models.Sequential()
model.add(layers.Dense(16, activation='relu', input_shape=(10000,)))
model.add(layers.Dense(16, activation='relu'))
model.add(layers.Dense(1, activation='sigmoid'))
model.compile(optimizer='rmsprop',
loss='binary_crossentropy',
metrics=['accuracy'])
ValueError: Only call `sigmoid_cross_entropy_with_logits` with named
arguments (labels=..., logits=..., ...)
アドバイスはありますか?
ありがとうございます!
どのKerasとTFバージョンを使用していますか? –
それはかなり奇妙に思えます... 'rmsprop'を' adam'に変更してみてください。 –
これはTensorFlowのバグであり、あなたのコードではありません。古いバージョンにダウングレードすることをお勧めします。 – Nejla