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