lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
2.61k stars 303 forks source link

我在更换数据集后发现如下问题 #224

Closed 1345149799 closed 7 months ago

1345149799 commented 8 months ago

Traceback (most recent call last): File "C:\Users\Administrator.conda\envs\rtdetr\lib\site-packages\torch\utils\data\dataloader.py", line 633, in next data = self._next_data() File "C:\Users\Administrator.conda\envs\rtdetr\lib\site-packages\torch\utils\data\dataloader.py", line 1345, in _next_data return self._process_data(data) File "C:\Users\Administrator.conda\envs\rtdetr\lib\site-packages\torch\utils\data\dataloader.py", line 1371, in _process_data data.reraise() File "C:\Users\Administrator.conda\envs\rtdetr\lib\site-packages\torch_utils.py", line 644, in reraise raise exception TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Users\Administrator.conda\envs\rtdetr\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "C:\Users\Administrator.conda\envs\rtdetr\lib\site-packages\torch\utils\data_utils\fetch.py", line 54, in fetch return self.collate_fn(data) File "C:\Users\Administrator\Desktop\code-lib\read-RT-DETR-main\rtdetr_pytorch\tools..\src\data\dataloader.py", line 29, in default_collate_fn return torch.cat([x[0][None] for x in items], dim=0), [x[1] for x in items] File "C:\Users\Administrator\Desktop\code-lib\read-RT-DETR-main\rtdetr_pytorch\tools..\src\data\dataloader.py", line 29, in return torch.cat([x[0][None] for x in items], dim=0), [x[1] for x in items] TypeError: 'Image' object is not subscriptable

此问题在训练途中出现,怀疑是某个图片样本的错误,但调试信息不显示这一块的变量,我想不到有什么方法能够调试到它。 多次训练均出现此错误且不一定出现在第0个epoch的哪个位置,所以单步调试也非常困难。 数据集是crowdhuman,遵循coco格式修改的。

1345149799 commented 8 months ago

补充一下,items给到的数据是一个list 图片1 报错时给到的数据是这样的 图片2 调查了一下coco和dataset的代码,没有发现出现未经过transform数据的原因

1345149799 commented 8 months ago

image image 今天发现PIL图像经过transorm时发生了异常,但不清楚原因是否是图像size过大

1345149799 commented 8 months ago

traceback.print_exc()通过调用此函数发现返回输出为PIL.Image.DecompressionBombError: Image size (188418615 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.建议在异常处理中加上此函数,因为该错误难以追踪

WaderLaken commented 5 months ago

我也出现这个错误,根本没法训练,请问解决了吗?

PIL.Image.DecompressionBombError: Image size (181239234 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

WaderLaken commented 5 months ago

我也出现这个错误,根本没法训练,请问解决了吗?

PIL.Image.DecompressionBombError: Image size (181239234 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

而且我数据集图像最大分辨率6000x8000,不知道为啥会超出

Regina971 commented 2 months ago

同问