Try setting batch_size to a smaller number. This error arrises when your batch_size is set to a larger value than your sample set size.
I was also facing the similar issue and noticed that batch_size was set to 64 whereas my sample training and validation set had only 16 and 8 images respectively. So I set batch_size to 4 and it ran successfully.
It may also arise when your sample_set is not correctly split. From what I understood is that the split should ideally be divisible by batch_size. For e.g., batch_size = 3 and sample_set_size is 10. Although I am not completely sure about this point. Maybe someone can correct me on this ?