MIScnn icon indicating copy to clipboard operation
MIScnn copied to clipboard

Failed batch pull if batch size is higher than sample number

Open muellerdo opened this issue 5 years ago • 0 comments
trafficstars

When does it occur: If the number of samples is very low and the batch size is higher than the number of available samples.
Can especially occur in full-image analysis without resizing images to a common shape. (therefore, it is not possible to combine the images into a batch)

What is happening then:

Traceback (most recent call last):
  File "miscnn/debugging.py", line 27, in <module>
    for img, seg in dataGen:
  File "/home/mudomini/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/utils/data_utils.py", line 472, in __iter__
    for item in (self[i] for i in range(len(self))):
  File "/home/mudomini/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/utils/data_utils.py", line 472, in <genexpr>
    for item in (self[i] for i in range(len(self))):
  File "/usr/local/lib/python3.6/dist-packages/miscnn-0.30-py3.6.egg/miscnn/neural_network/data_generator.py", line 63, in __getitem__
  File "/usr/local/lib/python3.6/dist-packages/miscnn-0.30-py3.6.egg/miscnn/neural_network/data_generator.py", line 151, in generate_batch
IndexError: pop from empty list

What should happen then: Either a error message saying that you have to reduce your batch size, or automatically reducing the batch size to the number of samples.

muellerdo avatar Apr 28 '20 20:04 muellerdo