Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataloader 报错 #22

Open
nkstatly opened this issue Jan 15, 2021 · 4 comments
Open

dataloader 报错 #22

nkstatly opened this issue Jan 15, 2021 · 4 comments

Comments

@nkstatly
Copy link

RuntimeError: Caught RuntimeError in DataLoader worker process 3.
Original Traceback (most recent call last):
File "/root/.local/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/root/.local/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/root/liyang/yolodet-pytorch/yolodet/dataset/loader/build_dataloader.py", line 92, in collate
clt[k] = torch.stack(v, 0)
RuntimeError: stack expects each tensor to be equal size, but got [3, 640, 640] at entry 0 and [3, 1280, 1280] at entry 6

是loader/build_dataloader.py 里面collate的问题?

@www516717402
Copy link

www516717402 commented Jan 26, 2021

@nkstatly 两种方案,稍微修改一下即可

  • 在collate里面先padding,然后在cat
  • 提前处理好数据

@nkstatly
Copy link
Author

@nkstatly 两种方案,稍微修改一下即可

  • 在collate里面先padding,然后在cat
  • 提前处理好数据

cfg中我注释了RandomAffine这一行,没有修改collate,能进行训练不报错
会不会是随机仿射变换时导致的

@wuzhihao7788
Copy link
Owner

能把你的cfg文件粘贴出来,我看一眼吗?

@nkstatly
Copy link
Author

能把你的cfg文件粘贴出来,我看一眼吗?

ppyolo_coco_100e.zip
多谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants