0

These two seem both array to me.

# suppose that test_data has [1000,728] shape 
print (test_data[0:1,:].shape)
# output [1,728]
print (test_data[0,:].shape)
# output [728,]

I tried these two arrays in keras sequential model.predict_classes(x) function. The test_data[0:1,:] works but test_data[0,:] gives error.

hpaulj
  • 221,503
  • 14
  • 230
  • 353
captainst
  • 617
  • 1
  • 7
  • 20
  • What is the `dtype` ? – Cedric H. Sep 22 '18 at 14:36
  • Code in title, does not match code in body. – ctrl-alt-delor Sep 22 '18 at 14:40
  • Check the `keras` documentation to see what expects. – hpaulj Sep 22 '18 at 15:06
  • 1
    I glanced at the `keras` doc for that function. It's vague about the required dimensions. Which means you/we need a more basic understanding of what `keras` expects across the board. I can explain the shape differences from a `numpy` perspective, but that won't help if `keras` has specific expectations. – hpaulj Sep 22 '18 at 18:37
  • @hpaulj I think that keras model.predict_classes(x) function expects an "array of array" argument of x – captainst Sep 23 '18 at 00:31

0 Answers0