首页 > 解决方案 > how to set correct batch_size and steps_per_epoch in keras?

问题描述

I have 20000 RGB images. I set batch_Size = 1 (due to GPU capacity). So now does it mean the model weights are changing with one-by-one pictures or it depends on the steps_per_epoch?

How should I set the steps_per_epoch and epochs for using all of 20000 images to be involved in training in different epochs?

标签: pythontensorflowkeras

解决方案


Yes, the weights are updated after each batch. The steps_per_epoch should be the number of datapoints (20000 in your case) divided by the batch size. Therefore steps_per_epoch will also be 20000 if the batch size is 1.


推荐阅读