positive666 / yolo_research

based on yolo-high-level project (detect\pose\classify\segment\):include yolov5\yolov7\yolov8\ core ,improvement research ,SwintransformV2 and Attention Series. training skills, business customization, engineering deployment C
GNU General Public License v3.0
758 stars 146 forks source link

TypeError: roll(): argument 'shifts' must be tuple of ints, not tuple #74

Closed summer202203 closed 2 years ago

summer202203 commented 2 years ago

❔Question

Additional context

Traceback (most recent call last): File "train.py", line 680, in main(opt) File "train.py", line 575, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 128, in train model = Model(cfg, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/content/drive/MyDrive/yolov5/models/yolo.py", line 121, in init m.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch, s, s))]) # forward File "/content/drive/MyDrive/yolov5/models/yolo.py", line 135, in forward return self._forward_once(x, profile, visualize) # single-scale inference, train File "/content/drive/MyDrive/yolov5/models/yolo.py", line 158, in _forward_once x = m(x) # run File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/content/drive/MyDrive/yolov5/models/common.py", line 715, in forward x = torch.roll(x, shifts=(self.shift_size, self.shift_size), dims=(1, 2)) TypeError: roll(): argument 'shifts' must be tuple of ints, not tuple

positive666 commented 2 years ago

I think you using a swinblock wrapped in yolov7, which is a shift of the wrong type, this is a complete YAML structure that I haven't sorted out yet, What's Your Run Command?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.