训练过程中出错

作者: Saif0765创建于 2022年8月20日更新于 2025年2月28日

/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/transforms/transforms.py:383: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. mode = random.choice(self.sample_options) Traceback (most recent call last): File "train.py", line 358, in <module> device=DEVICE, debug_steps=args.debug_steps, epoch=epoch) File "train.py", line 136, in train for i, data in enumerate(loader): File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1376, in _next_data return self._process_data(data) File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1402, in _process_data data.reraise() File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 461, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataset.py", line 235, in __getitem__ return self.datasets[dataset_idx][sample_idx] File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/datasets/voc_dataset.py", line 61, in __getitem__ image, boxes, labels = self.transform(image, boxes, labels) File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/ssd/data_preprocessing.py", line 33, in __call__ return self.augment(img, boxes, labels) File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/transforms/transforms.py", line 75, in __call__ img, boxes, labels = t(img, boxes, labels) File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/transforms/transforms.py", line 129, in __call__ boxes[:, 0] /= width IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

内容来源: Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB