9
,當我得到以下錯誤Tensorflow誤差計算交叉熵損失
ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int32: 'Tensor("Placeholder_1:0", shape=TensorShape([Dimension(128), Dimension(2)]), dtype=int32)'
,當我試圖計算交叉熵損失
losses = tf.nn.softmax_cross_entropy_with_logits(scores, input_y)
我使用Python 3.4.3。
任何想法爲什麼?
謝謝,鑄造解決了這個問題。 – anamar
我在tflearn中找不到cast或to_float,我們必須導入哪個模塊? – f3n1Xx
'tf.cast()'和'tf.to_float()'是TensorFlow函數,所以你可以使用'import tensorflow as tf'來獲得它們。 – mrry