eriklindernoren / PyTorch-YOLOv3

Minimal PyTorch implementation of YOLOv3
GNU General Public License v3.0
7.32k stars 2.63k forks source link

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

Closed lyjslay closed 1 year ago

lyjslay commented 5 years ago

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 batchi, (, 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 commented 5 years ago

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

yhx0105 commented 5 years ago

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

leJson commented 5 years ago

我也遇到同样的报错,解决了.我这边出现这个问题的原因是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. )

lyjslay commented 5 years ago

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 !

chouxianyu commented 4 years ago

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

flandrewries commented 4 years ago

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

Abermal commented 1 year ago

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.

StrugglingForBetter commented 11 months ago

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?