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))

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
ValueError: logits and labels must have the same shape ((None, 4000) vs (None, 1)) logits and labels must have the same shape ((None, 84) vs (None, 1)) logits and labels must have the same shape ((None, 28) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 6) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 2) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 6) vs (None, 1) ValueError: logits and labels must have the same shape ((None, 2) vs (None, 1)) tensorlfow logits and labels must have the same shape ((None, 1739) vs (None, 1)) logits and labels must have the same shape ((None, 5, 5, 1) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 28, 28, 1) vs (None, 1)) logits and labels must have the same shape ((None, 256, 256, 2) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 176, 1) vs (None, 1, 1)) tensorflow ValueError: logits and labels must have the same shape ((None, 6, 6, 10) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 5) vs (None, 6)) "ValueError: logits and labels must have the same shape ((None, 2) vs (None, 1))" ValueError: logits and labels must have the same shape ((32, 10) vs (32, 1))+ ValueError: logits and labels must have the same shape ((None, 128, 128, 1) vs (None, 256, 256, 1)) ValueError: logits and labels must have the same shape ((None, 128, 128, 1) vs (None, 256, 256, 1)) ValueError: logits and labels must have the same shape ((None, 3) vs (None, 1)) metrics error ValueError: logits and labels must have the same shape ((None, 1000) vs (None, 1)) logits and labels must have the same shape ((None, 30, 30, 1) vs (None, 1)) logits and labels must have the same shape ((None, 28, 28, 1) vs (None, 10)) logits and labels must have the same shape ((167, 2) vs (167, 1) ValueError: logits and labels must have the same shape ((None, 17) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 1) vs (None, 3)) ValueError: logits and labels must have the same shape ((None, 2) vs (None, 3)) ValueError: logits and labels must have the same shape ((None, 19) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 2) vs (None, 2, 2)) ValueError: logits and labels must have the same shape ((32, 1) vs (32, 2)) ValueError: logits and labels must have the same shape ((None, 2) vs (None, 2, 2)) logits and labels must have the same first dimension, got logits shape [3,6] and labels shape [18] logits and labels must have the same shape ((None, 2) vs (None, 1)) keras python logits and labels must have the same shape ((None, 64) vs (None, 1)) logits and labels must have the same shape ((1, 16, 16, 1) vs (1, 1)) ValueError: logits and labels must have the same shape ((1, 16, 16, 1) vs (1, 1)) logits and labels must have the same shape ((None, 5) vs (None, 6)) logits and labels must have the same shape ((None, 2) vs (None, 6)) logits and labels must have the same shape ((None, 10) vs (None, 1)) logits and labels must have the same shape ((None, 32) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 100, 109) vs (None, 109)) logits and labels must have the same shape ((None, 3) vs (None, 1)) logits and labels must have the same shape ((None, 28, 10) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 8) vs (None, 1)) logits and labels must have the same shape error raise ValueError("logits and labels must have the same shape (%s vs %s)" % logits and labels must have the same shape ((None, 6) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 1) vs (None, 12)) ValueError("logits and labels must have the same shape (%s vs %s)" % ValueError: logits and labels must have the same shape ((None, 1) vs (None, 12)) ValueError: logits and labels must have the same shape ((None, 4) vs (None, 12)) ValueError: logits and labels must have the same shape ((16, 64) vs (16, 1)) logits and labels must have the same shape ((2, 64) vs (2, 1)) alueError: logits and labels must have the same shape ((None, 175) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 15) vs (None, 16)) logits and labels must have the same shape ((10, 1) vs (10, 0)) ValueError: logits and labels must have the same shape ((None, 34) vs (None, 1)) logits and labels must have the same shape ((None, 8, 3, 34) vs (None, 1)) generator logits and labels must have the same shape ((None, 8, 3, 34) vs (None, 1)) ValueError: logits and labels must have the same shape ((60, 2048) vs (60, 128, 128, 3)) ValueError: logits and labels must have the same shape ((32, 2) vs (32, 1)) binarycrossentropy ValueError: logits and labels must have the same shape ((5, 2) vs (5, 1)) logits and labels must have the same shape ((None, 13) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 3, 3, 1) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 512, 512, 2) vs (None, None)) logits and labels must have the same shape ((None, 512, 512, 2) vs (None, None)) alueError: logits and labels must have the same shape ((None, 25) vs (None, 1513) ValueError: logits and labels must have the same shape ((None, 25) vs ValueError: logits and labels must have the same shape ((None, 25) vs (None, 1513)) logits and labels must have the same shape ((None, 11) vs (None, 1)) keras ValueError: logits and labels must have the same shape ((None, 11) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 1) vs (None, 0)) ValueError: logits and labels must have the same shape ((None, 1) vs ()) logits and labels must have the same shape ((None, 1, 1, 10) vs (None, 10)) keras ValueError: logits and labels must have the same shape ((None, 64) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 28, 28, 1) vs (None, 32, 32, 1)) logits and labels must have the same shape ((None, 28, 28, 1) vs (None, 32, 32, 1)) logits and labels must have the same shape ((None, None, None, 1) vs (None, 1)) logits and labels must have the same shape ((None, 1) vs (None, 6)) ValueError: logits and labels must have the same shape ((1, 1) vs (1, 4)) ValueError: logits and labels must have the same shape ((None, 1) vs (None, 4)) ValueError: logits and labels must have the same shape ((64, 2) vs (64, 1)) site:stackoverflow.com logits and labels must have the same first dimension, got logits shape [3,16] and labels shape [48] logits and labels must have the same shape ((1, 1) vs (None, 2)) (logits.get_shape(), labels.get_shape())) ValueError: logits and labels must have the same shape ((?, 4, 255, 255, 5) vs (?, 4, 64, 64, 5)) python ValueError: logits and labels must have the same shape ((None, 1) vs (None, 4)) logits and labels must have the same shape ((none, 4, 255, 255, 5) vs (none, 4, 64, 64, 5)) horglass tensorflow issue training valueerror: logits and labels must have the same shape ((none, 4, 255, 255, 5) vs (none, 4, 64, 64, 5)) horglass tensorflow issue valueerror: logits and labels must have the same shape ((none, 4, 255, 255, 5) vs (none, 4, 64, 64, 5))+ horglass tensorflow alueError: logits and labels must have the same shape ((None, 2) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 4, 255, 255, 4) vs (None, 4, 64, 64, 4)) tf2 tf.nn.sigmoid_cross_entropy_with_logits tf2+ValueError: logits and labels must have the same shape ((None, 4, 255, 255, 5) vs (None, 4, 64, 64, 5)) logits and labels must have the same shape ((None, 4, 255, 255, 5) vs (None, 4, 64, 64, 5)) raise ValueError("logits and labels must have the same shape raise ValueError(logits and labels must have the same shape (%s vs %s) % ValueError: logits and labels must have the same shape ((None, 4, 255, 255, 5) vs (None, 4, 64, 64, 5)) raise ValueError("logits and labels must have the same shape (%s vs %s)" % ValueError: logits and labels must have the same shape ((None, 4, 255, 255, 5) vs (None, 4, 64, 64, 5)) ValueError: logits and labels must have the same shape ((None, 4, 255, 255, 5) vs (None, 4, 64, 64, 5)) raise ValueError(logits and labels must have the same shape (%s vs %s) % ValueError: logits and labels must have the same shape ((None, 1) vs (None, 250)) raise ValueError("logits and labels must have the same shape (%s vs %s)" % ValueError: logits and labels must have the same shape ((None, 1) vs (None, 250)) ValueError: logits and labels must have the same shape ((None, 6) vs (None, 1)) ValueError: logits and labels must have the same shape ((10, 2) vs (10, 1)) ValueError: logits and labels must have the same shape ((None, 3) vs (None, 1)) logits and labels must have the same shape ((10, 1) vs (10,)) ValueError: logits and labels must have the same shape ((None, 62, 62, 2) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 70, 64, 64, 1) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 12) vs (None, 1)) ValueError: logits and labels must have the same shape ((8, 1) vs (1, 1)) ValueError: logits and labels must have the same shape ((11, 1) vs (1, 1)) tensorflow ValueError: logits and labels must have the same shape ((11, 1) vs ()) logits and labels must have the same shape ((None, None, None, 2) vs (None, None)) ValueError: logits and labels must have the same shape ((None, 4, 4, 15) vs (None, None)) logits and labels must have the same shape ((32, 2) vs (32, 1)) ValueError: logits and labels must have the same shape ((None, 70, 320, 240, 1) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 10) vs (None, 1)) ValueError: logits and labels must have the same shape ((16, 3) vs (16, 2)) logits and labels must have the same shape ((None, 1) vs (None, 2)) ValueError: logits and labels must have the same shape ((None, 1) vs (None, 6)) ValueError: logits and labels must have the sameshape ((None, 28, 28, 1) vs (None, 28, 20, 1)) ValueError: logits and labels must have the same shape ((None, 4) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 2) vs (None, 6)) ValueError: logits and labels must have the same shape ((None, 128) vs (None, 1)) logits and labels must have the same first dimension, got logits shape 32 9 and labels shape 288 ValueError: logits and labels must have the same shape ((None, 23, 23, 1) vs (None, 25, 25, 1)) ValueError: logits and labels must have the same shape ValueError: logits and labels must have the same shape ((None, 14, 14, 5) vs (None, None)) ValueError: logits and labels must have the same shape ((None, 25) vs (None, 1)) logits and labels must have the same shape ValueError: logits and labels must have the same shape ((None, 2) vs (None, 1)) logits and labels must have the same shape ((None, 8, 8, 1) vs (None, 1)) logits and labels must have the same shape ((None, 2) vs (None, 1)) ValueError: logits and labels must have the same shape ((None, 1) vs (None, 2))
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source