keras-yolo3: Getting StopIteration: 'NoneType' object is not subscriptable

count 	[44][5]
loss: 	[44][57.3060036]
loss: 	[44][173.999207]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 578, in get
    inputs = self.queue.get(block=True).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 401, in get_index
    return _SHARED_SEQUENCES[uid][i]
  File "/content/drive/keras-yolo3/generator.py", line 73, in __getitem__
    img, all_objs = self._aug_image(train_instance, net_h, net_w)
  File "/content/drive/keras-yolo3/generator.py", line 160, in _aug_image
    image = cv2.imread(image_name)[:,:,::-1] # RGB image
TypeError: 'NoneType' object is not subscriptable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "train.py", line 251, in <module>
    _main_(args)
  File "train.py", line 210, in _main_
    max_queue_size   = 4
  File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 2192, in fit_generator
    generator_output = next(output_generator)
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 584, in get
    six.raise_from(StopIteration(e), e)
  File "<string>", line 3, in raise_from
StopIteration: 'NoneType' object is not subscriptable

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@Sun-Wu-kon yeah it’s filename gets changed. But even after having the images in png format it gave me an error . Are you able to train the model ?

I met the same problem,did you solve it?@ninjakx