Replies: 1 comment
-
@yueyuehao 👋 hi, thanks for letting us know about this possible problem with YOLOv5 🚀. We've created a few short guidelines below to help users provide what we need in order to start investigating a possible problem. How to create a Minimal, Reproducible ExampleWhen asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:
For Ultralytics to provide assistance your code should also be:
If you believe your problem meets all the above criteria, please close this issue and raise a new one using the 🐛 Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem. Thank you! 😃 |
Beta Was this translation helpful? Give feedback.
-
An error was reported running yolov5-5.0 test.py:TypeError: 'NoneType' object is not subscriptable.Why is this a problem and what can be done about it? Thanks in advance for reading such a long entry and replying.
Traceback (most recent call last):
File "test1.py", line 313, in
test(opt.data,
File "test1.py", line 100, in test
for batch_i, (img, targets, paths, shapes) in enumerate(tqdm(dataloader, desc=s)):
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/tqdm/std.py", line 1195, in iter
for obj in iterable:
File "/media/hdd/haoyue/yolov5/utils/datasets.py", line 104, in iter
yield next(self.iterator)
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 681, in next
data = self._next_data()
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1376, in _next_data
return self._process_data(data)
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1402, in _process_data
data.reraise()
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/_utils.py", line 461, in reraise
raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/bme1/.conda/envs/yolov5/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/media/hdd/haoyue/yolov5/utils/datasets.py", line 552, in getitem
degrees=hyp['degrees'],
TypeError: 'NoneType' object is not subscriptable
Beta Was this translation helpful? Give feedback.
All reactions