PyTorch-YOLOv3 icon indicating copy to clipboard operation
PyTorch-YOLOv3 copied to clipboard

RuntimeError: Trying to resize storage that is not resizable at…

Open lyjslay opened this issue 5 years ago • 6 comments

when i train my datasets,after i execute “python train.py --model_def config\yolov3.cfg --data_config config\custom.data --pretrained_weights weights\darknet53.conv.74“ in cmd,it gives me the following "Runtime error":

*Traceback (most recent call last): File "train.py", line 99, in for batch_i, (_, imgs, targets) in enumerate(dataloader): File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 568, in next return self._process_next_batch(batch) File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) RuntimeError: Traceback (most recent call last): File "C:\ProgramData\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:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "C:\Users\Administrator.SC-201907191055\Desktop\PyTorch-YOLOv3-master\utils\datasets.py", line 121, in getitem boxes[:, 3] = w_factor / padded_w RuntimeError: Trying to resize storage that is not resizable at ..\aten\src\TH\THStorageFunctions.cpp:76

i don't know why,please help me.thank you.

lyjslay avatar Jul 22 '19 05:07 lyjslay

by the way,the cfg file named "yolov3.cfg" was edited according to my datasets' classes,the classes are 2 and fliiters is 21

lyjslay avatar Jul 22 '19 05:07 lyjslay

I also met the problem,but it told me that it could't find the file

yhx0105 avatar Jul 23 '19 06:07 yhx0105

我也遇到同样的报错,解决了.我这边出现这个问题的原因是trian中某个图像文件对应的标签文件为空,剔除掉后,问题就解决了.(for English speaker: I met the same "Runtime error" as you and have solved it.I fond that there were some image files for training get an empty labels files(.txt).After I deleted it from my train date sets,every thing goes right. )

leJson avatar Jul 30 '19 01:07 leJson

he same "Runtime error" as you and have solved it.I fond that there were some image files for training get an empty labels files(.txt).After I deleted it from my train date sets,every thing goes right.

solve it ,thank u !

lyjslay avatar Jul 30 '19 06:07 lyjslay

确实是因为某张图片对应的txt标注文件中是空的,导致了这个报错。

chouxianyu avatar Jan 30 '20 10:01 chouxianyu

when i use bdd100k:100k detection to train yolov3-pytorch, this occurs in with 2019d3d4-f10fe8c4.txt additionaly, 100k only have 69863 training lables(including the 2019d3d4-f10fe8c4.txt) may help your to save time. --southeast university ins department auto-lab

flandrewries avatar Mar 25 '20 02:03 flandrewries

The best way to debug this is to iterate through the dataloader in the normal for loop.
My problem was that mt dataset fetched sometimes samples of different shapes.

Abermal avatar Feb 07 '23 20:02 Abermal

The best way to debug this is to iterate through the dataloader in the normal for loop. My problem was that mt dataset fetched sometimes samples of different shapes.

Can you show us how to do that in a more detailed way?

StrugglingForBetter avatar Oct 25 '23 07:10 StrugglingForBetter