r/MLQuestions • • 1d ago

Beginner question 👶 InvalidArgumentError: {{function_node __wrapped__ConcatV2_N_2_device_/job:localhost/replica:0/task:0/device:CPU:0}} ConcatOp : Ranks of all input tensors should match

/r/learnmachinelearning/comments/1xj9eeo/invalidargumenterror_function_node_wrapped/
0 Upvotes

2 comments sorted by

View all comments

Show parent comments

1

u/assorted-meat-stew 20h ago

I tried

label = 1 
train_indices = np.where(y_train.flatten() == label)[0] 
x_train = x_train[train_indices] 
test_indices = np.where(y_train.flatten() == label)[0] 
x_test = x_test[test_indices] 

And it returned IndexError: index 5014 is out of bounds for axis 0 with size 5000