Answers for "ValueError: `logits` and `labels` must have the same shape, received ((None, 7) vs (None, 1))."

2

ValueError: logits and labels must have the same shape ((None, 1) vs (None, 2))

# 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))
Posted by: Guest on December-08-2020
0

ValueError: `logits` and `labels` must have the same shape, received ((None, 7) vs (None, 1)).

model.add(Flatten())
Posted by: Guest on April-04-2022
0

ValueError: `logits` and `labels` must have the same shape, received ((None, 7) vs (None, 1)).

model.add(GlobalAveragePooling2D())
Posted by: Guest on April-04-2022

Code answers related to "ValueError: `logits` and `labels` must have the same shape, received ((None, 7) vs (None, 1))."

Browse Popular Code Answers by Language