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

训练两个epoch之后依然报错,希望得到大家的帮助 #17

Open
1246886181 opened this issue Dec 14, 2020 · 1 comment
Open

Comments

@1246886181
Copy link

train words:python tools/train.py --work_dir results cfg/yolov5_coco_100e.py --device 0 --validate

Traceback (most recent call last):
File "tools/train.py", line 144, in
main()
File "tools/train.py", line 140, in main
train_detector(model,datasets,cfg,validate=args.validate,timestamp=timestamp,meta=meta)
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/apis/train.py", line 161, in train_detector
runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/apis/runner.py", line 331, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/apis/runner.py", line 230, in train
self.call_hook('after_train_epoch')
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/apis/runner.py", line 205, in call_hook
getattr(hook, fn_name)(self)
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/models/hooks/eval_hook.py", line 52, in after_train_epoch
results = single_gpu_test(model, self.dataloader)
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/apis/test.py", line 93, in single_gpu_test
output = non_max_suppression(inf_out, conf_thres=conf_thres, iou_thres=iou_thres, merge=merge)
File "/home/tongyu/develop-project/yolodet-pytorch-master/yolodet/models/heads/base.py", line 355, in non_max_suppression
i = torchvision.ops.boxes.nms(boxes, scores, iou_thres)
File "/home/tongyu/.conda/envs/yolodet/lib/python3.6/site-packages/torchvision/ops/boxes.py", line 40, in nms
return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
RuntimeError: Trying to create tensor with negative dimension -1203535890: [-1203535890]

@wuzhihao7788
Copy link
Owner

这个问题目前我在做实验的时候还没有遇到过,似乎是张量形状有问题。请确认你的pytorch版本好

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

2 participants