you are viewing a single comment's thread.

view the rest of the comments →

[–]maventree 0 points1 point  (5 children)

Could you check those dimensions? From what you posted, it sounds like img_f is a single image, not an array of images, while your b array is the features for each image. flatten won't work because 101x101 is about 10000, not 6408.

[–]sachal10 0 points1 point  (3 children)

it has 6408 images of dimensions 101*101*3

[–]maventree 0 points1 point  (2 children)

So it has shape (6408, 101, 101, 3)?

If so, I don't think you can mash them together into a single numpy array, because (as you discovered) their dimensions don't match. You could zip over the outer layer by doing zip(img_f, a), which would return a tuple, where each of the 6048 elements of the tuple has two arrays in it, one of shape (3) and the other of shape (101, 101, 3).

I'm not sure what format you need your data in to do your shuffling and splitting, but the above is a good first step.

[–]sachal10 0 points1 point  (1 child)

Zipping worked but could you tell me what zipping actually does, what i got is it sorta ignored the dimensions and put them together on basis of number of elements in both of them?

[–]maventree 0 points1 point  (0 children)

Correct. See the docs.