Когда я использую yolo v3 на pytorch для обучения некоторых данных, он выдает ошибку вроде:
Epoch gpu_mem GIoU obj cls total targets img_size
Traceback (most recent call last):
File "train.py", line 433, in <module>
train() # train normally
File "train.py", line 310, in train
results, maps = test.test(cfg,
File "D:\code\pytorch\yolo\yolov3\test.py", line 74, in test
for batch_i, (imgs, targets, paths, shapes) in enumerate(tqdm(dataloader, desc=s)):
File "D:\code\anaconda\envs\test\lib\site-packages\tqdm\std.py", line 1108, in __iter__
for obj in iterable:
File "D:\code\anaconda\envs\test\lib\site-packages\torch\utils\data\dataloader.py", line 345, in __next__
data = self._next_data()
File "D:\code\anaconda\envs\test\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data
return self._process_data(data)
File "D:\code\anaconda\envs\test\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data
data.reraise()
File "D:\code\anaconda\envs\test\lib\site-packages\torch\_utils.py", line 394, in reraise
raise self.exc_type(msg)
cv2.error: Caught error in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\code\anaconda\envs\test\lib\site-packages\torch\utils\data\_utils\worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "D:\code\anaconda\envs\test\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\code\anaconda\envs\test\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\code\pytorch\yolo\yolov3\utils\datasets.py", line 432, in __getitem__
img, ratio, pad = letterbox(img, shape, auto=False, scaleup=self.augment)
File "D:\code\pytorch\yolo\yolov3\utils\datasets.py", line 630, in letterbox
img = cv2.copyMakeBorder(img, top, bottom, left, right, cv2.BORDER_CONSTANT, value=color) # add border
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\core\src\copy.cpp:1421: error: (-215:Assertion failed) top >= 0 && bottom >= 0 && left >= 0 && right >= 0 && _src.dims() <= 2 in function 'cv::copyMakeBorder'
Class Images Targets P R mAP@0.5 F1: 0%| | 0/5 [00:08<?, ?it/s](test)
Я пытаюсь найти какое-то решение в Google. https://github.com/facebook/Surround360/issues/201, но это не помогает мне Поэтому, пожалуйста, помогите мне решить эту проблему.
Вот некоторые из моих изображений поездов.