📌  相关文章
📜  ValueError: logits and labels must have the same shape ((None, 1) vs (None, 2)) - Python代码示例

📅  最后修改于: 2022-03-11 14:46:10.958000             🧑  作者: Mango

代码示例1
# you should reshape your labels as 2d-tensor
# the first dimension will be the batch dimension and the second the scalar label)

y_train = np.asarray(train_labels).astype('float32').reshape((-1,1))
y_test = np.asarray(test_labels).astype('float32').reshape((-1,1))