Getting StopIteration: 'NoneType' object is not subscriptable
See original GitHub issuecount [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
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
TypeError: 'NoneType' object is not subscriptable in function
it is throwing type error because the value of 'value' is None. to avoid getting this error try- if value !=
Read more >Python TypeError: 'NoneType' object is not subscriptable
The “TypeError: 'NoneType' object is not subscriptable” error is raised when you try to access items from a None value using indexing. This...
Read more >StopIteration: 'PngImageFile' object is not subscriptable
StopIteration : 'PngImageFile' object is not subscriptable. python学习 keras ... line 578, in get inputs = self.queue.get(block=True).get() File ...
Read more >[Solved] TypeError: 'NoneType' Object is Not Subscriptable
The error, NoneType object is not subscriptable, means that you were trying to subscript a NoneType object. This resulted in a type error....
Read more >Python TypeError: cannot unpack non-iterable NoneType object
In Python, TypeError is subclass of Exception. Python sequence can be unpacked. This means you can assign content of sequence to multiple ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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