Lam1360 / YOLOv3-model-pruning

在 oxford hand 数据集上对 YOLOv3 做模型剪枝(network slimming)
MIT License
1.67k stars 432 forks source link

求助:稀疏化训练报错 #41

Open chensi41 opened 5 years ago

chensi41 commented 5 years ago

Traceback (most recent call last): File "train.py", line 129, in for batchi, (, imgs, targets) in enumerate(dataloader): File "C:\Users\86151\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 582, in next return self._process_next_batch(batch) File "C:\Users\86151\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) ValueError: Traceback (most recent call last): File "C:\Users\86151\Anaconda3\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "C:\Users\86151\Anaconda3\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "D:\BaiduNetdiskDownload\YOLOv3-model-pruning-master\YOLOv3-model-pruning-master\utils\datasets.py", line 128, in getitem img, boxes = augment(img, boxes) File "D:\BaiduNetdiskDownload\YOLOv3-model-pruning-master\YOLOv3-model-pruning-master\utils\augmentations.py", line 29, in augment augmented = aug(image=image, bboxes=boxes_coord, category_id=labels) File "C:\Users\86151\Anaconda3\lib\site-packages\albumentations\core\composition.py", line 189, in call convert_bboxes_to_albumentations, data) File "C:\Users\86151\Anaconda3\lib\site-packages\albumentations\core\composition.py", line 249, in data_preprocessing data[data_name] = convert_fn(data[data_name], params['format'], rows, cols, check_validity=True) File "C:\Users\86151\Anaconda3\lib\site-packages\albumentations\augmentations\bbox_utils.py", line 158, in convert_bboxes_to_albumentations return [convert_bbox_to_albumentations(bbox, source_format, rows, cols, check_validity) for bbox in bboxes] File "C:\Users\86151\Anaconda3\lib\site-packages\albumentations\augmentations\bbox_utils.py", line 158, in return [convert_bbox_to_albumentations(bbox, source_format, rows, cols, check_validity) for bbox in bboxes] File "C:\Users\86151\Anaconda3\lib\site-packages\albumentations\augmentations\bbox_utils.py", line 118, in convert_bbox_to_albumentations check_bbox(bbox) File "C:\Users\86151\Anaconda3\lib\site-packages\albumentations\augmentations\bbox_utils.py", line 184, in check_bbox value=value, ValueError: Expected x_max for bbox [0.9494795, 0.5703125, 1.0000005, 0.6145835000000001, 0.0] to be in the range [0.0, 1.0], got 1.0000005.

Gavin666Github commented 5 years ago

我也遇到了这个错误,请问解决了吗

xiao-an-qi commented 4 years ago

@chensi41 请问解决了吗?是需要把边框宽高限制在[0,1.]?

zhuozhongshuo commented 3 years ago

@xiao-an-qi @Gavin666Github @chensi41 这是因为数据预处理的时候加了pading,把图pad到正方形了。可以注释掉pading的功能,直接使用原图和原始label进行训练,就不会报这个错