解决shapes (none,111) and (none,111) are incompatible

1,sparse_categorical_crossentropy和categorical_crossentropy的区别

对应解决这类问题:“logits and labels must have the same first dimension, got logits shape [32,28] and labels shape [3360]".

出现这个错误的原因就是网络最终输出shape和label的shape不一致

My features and labels matrices have the same 2 dimensions (number of sentences, length of max sentence). 亦即都是(1257,111)

categorical_crossentropy和sparse_categorical_crossentropy - 熊猫blue - 博客园

tensorflow - ValueError: Shapes (None, 1) and (None, 2) are incompatible - Stack Overflow

都是计算多分类crossentropy的,

你可能感兴趣的:(机器学习入门,深度学习,cnn,机器学习)