Running into the same problem, tried to use dask but am getting the same error. Where am I going astray?
import dask.array as da
#testms = da.from_array(conv_test_feat)
conv_test_feat = da.from_array(conv_test_feat,chunks=(1000, 512, 22, 40))
preds = da.from_array(preds, chunks=(100,8))
test_batches = gen.flow(conv_test_feat, preds, batch_size=16)
ValueError Traceback (most recent call last)
<ipython-input-247-ba8f45991d06> in <module>()
----> 1 test_batches = gen.flow(conv_test_feat, preds, batch_size=16)
/home/jd/anaconda3/lib/python3.5/site-packages/keras/preprocessing/image.py in flow(self, X, y, batch_size, shuffle, seed, save_to_dir, save_prefix, save_format)
425 save_to_dir=save_to_dir,
426 save_prefix=save_prefix,
--> 427 save_format=save_format)
428
429 def flow_from_directory(self, directory,
/home/jd/anaconda3/lib/python3.5/site-packages/keras/preprocessing/image.py in __init__(self, x, y, image_data_generator, batch_size, shuffle, seed, dim_ordering, save_to_dir, save_prefix, save_format)
688 'either 1, 3 or 4 channels on axis ' + str(channels_axis) + '. '
689 'However, it was passed an array with shape ' + str(self.x.shape) +
--> 690 ' (' + str(self.x.shape[channels_axis]) + ' channels).')
691 if y is not None:
692 self.y = np.asarray(y)
ValueError: NumpyArrayIterator is set to use the dimension ordering convention "th" (channels on axis 1), i.e. expected either 1, 3 or 4 channels on axis 1. However, it was passed an array with shape (1000, 512, 22, 40) (512 channels).