You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an unkown error, while iterating through my data generator. I have followed the same instructions provided. I am using the PASCAL VOC 2012.
with open('/content/2012_train.txt', encoding='utf-8') as f:
train_lines = f.readlines()
with open( '/content/2012_val.txt', encoding='utf-8') as f:
val_lines = f.readlines()
I have used the YoloDataset from the repo itself , all same
And I am running this code (to see my images and boxes in gen):
for img2, box2 in gen_val:
img=img2
box=box2
break
And there I get the following error :
Error :
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-83-5f541636a18e>](https://localhost:8080/#) in <cell line: 1>()
----> 1 for img2, box2 in gen_val:
2 img=img2
3 box=box2
4 break
3 frames
[/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in __next__(self)
628 # TODO(https://github.com/pytorch/pytorch/issues/76750)
629 self._reset() # type: ignore[call-arg]
--> 630 data = self._next_data()
631 self._num_yielded += 1
632 if self._dataset_kind == _DatasetKind.Iterable and \
[/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in _next_data(self)
1342 else:
1343 del self._task_info[idx]
-> 1344 return self._process_data(data)
1345
1346 def _try_put_index(self):
[/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in _process_data(self, data)
1368 self._try_put_index()
1369 if isinstance(data, ExceptionWrapper):
-> 1370 data.reraise()
1371 return data
1372
[/usr/local/lib/python3.10/dist-packages/torch/_utils.py](https://localhost:8080/#) in reraise(self)
704 # instantiate since we don't know how to
705 raise RuntimeError(msg) from None
--> 706 raise exception
707
708
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/worker.py", line 309, in _worker_loop
data = fetcher.fetch(index) # type: ignore[possibly-undefined]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py", line 52, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "<ipython-input-61-b6184597b9a6>", line 49, in __getitem__
image, box = self.get_random_data(self.annotation_lines[index], self.input_shape, random = self.train)
File "<ipython-input-61-b6184597b9a6>", line 100, in get_random_data
box = np.array([np.array(list(map(int,box.split(',')))) for box in line[1:]])
File "<ipython-input-61-b6184597b9a6>", line 100, in <listcomp>
box = np.array([np.array(list(map(int,box.split(',')))) for box in line[1:]])
TypeError: 'range' object is not callable
I need guidance over this and help me to solve this issue.
The text was updated successfully, but these errors were encountered:
I am getting an unkown error, while iterating through my data generator. I have followed the same instructions provided. I am using the PASCAL VOC 2012.
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2010_004120.jpg 23,107,493,330,8
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2008_001742.jpg 40,99,154,375,15
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2011_001669.jpg 331,240,359,259,7
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2007_007161.jpg 5,57,332,500,15
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2012_002212.jpg 76,7,283,404,15
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2010_004807.jpg 45,122,400,341,12 234,47,467,167,12
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2011_004769.jpg 159,95,292,436,15
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2009_001013.jpg 144,24,243,258,15 35,88,377,362,13
/content/VOC2012_train_val/VOC2012_train_val/JPEGImages/2012_003165.jpg 194,192,275,471,15
YoloDataset
from the repo itself , all sameAnd there I get the following error :
Error :
I need guidance over this and help me to solve this issue.
The text was updated successfully, but these errors were encountered: