I am having an error while trainining for segmention like this: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 3 dimension(s) it does some epochs like 30, sometimes less and then gives this error.
The error is:
the full error:
Traceback (most recent call last):
File "segment/train.py", line 681, in
main(opt)
File "segment/train.py", line 577, in main
train(opt.hyp, opt, device, callbacks)
File "segment/train.py", line 295, in train
for i, (imgs, targets, paths, _, masks) in pbar: # batch ------------------------------------------------------
File "/home/odyssey/.local/lib/python3.8/site-packages/tqdm/std.py", line 1195, in iter
for obj in iterable:
File "/home/odyssey/Leonardo/datasets/segmentation/./utils/dataloaders.py", line 171, in iter
yield next(self.iterator)
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 628, in next
data = self._next_data()
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1313, in _next_data
return self._process_data(data)
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1359, in _process_data
data.reraise()
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/_utils.py", line 543, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/odyssey/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 58, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/odyssey/Leonardo/datasets/segmentation/./utils/segment/dataloaders.py", line 116, in getitem
img, labels, segments = mixup(img, labels, segments, *self.load_mosaic(random.randint(0, self.n - 1)))
File "/home/odyssey/Leonardo/datasets/segmentation/./utils/segment/augmentations.py", line 21, in mixup
segments = np.concatenate((segments, segments2), 0)
File "<array_function internals>", line 180, in concatenate
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 3 dimension(s)
I already check if the dataset and labels were correct