Chunks the training to avoid memory error on 32-bit machines