我在 Tensorflow 中有代码,使用卷积神经网络来识别街景文本(SVT)数据中的字符。
由于标签类型是字符串,我应该tf.nn.sparse_softmax_cross_entropy_with_logits()在损失函数中使用什么来代替?
我不能使用tf.nn.sparse_softmax_cross_entropy_with_logits(),因为她的标签必须是 int dtype?
我在 Tensorflow 中有代码,使用卷积神经网络来识别街景文本(SVT)数据中的字符。
由于标签类型是字符串,我应该tf.nn.sparse_softmax_cross_entropy_with_logits()在损失函数中使用什么来代替?
我不能使用tf.nn.sparse_softmax_cross_entropy_with_logits(),因为她的标签必须是 int dtype?
损失函数是正确的,您只需使用 one-hot 向量编码将分类变量转换为数值表示。请看看这个。