N = 10000
images = ((i, np.random.random_integers(1, 100, size=(500, 500))) for i in
    range(N))
pool = multiprocessing.Pool(4)
pool.imap(func, images)
pool.close()
pool.join()
Multiprocessing IOError: bad message length