roboflow / notebooks

Examples and tutorials on using SOTA computer vision models and techniques. Learn everything from old-school ResNet, through YOLO and object-detection transformers like DETR, to the latest models like Grounding DINO and SAM.
https://roboflow.com/models
4.76k stars 742 forks source link

Yolov6 inference runtime error #251

Open nagarajuys opened 4 months ago

nagarajuys commented 4 months ago

Search before asking

Notebook name

train-yolov6-object-detection-on-custom-data.ipynb

Bug

Fusing model... Switch model to deploy modality. Traceback (most recent call last): File "/content/YOLOv6/tools/infer.py", line 120, in main(args) File "/content/YOLOv6/tools/infer.py", line 115, in main run(vars(args)) File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "/content/YOLOv6/tools/infer.py", line 107, in run inferer = Inferer(source, webcam, webcam_addr, weights, device, yaml, img_size, half) File "/content/YOLOv6/yolov6/core/inferer.py", line 50, in init self.model(torch.zeros(1, 3, self.img_size).to(self.device).type_as(next(self.model.model.parameters()))) # warmup File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, kwargs) File "/content/YOLOv6/yolov6/layers/common.py", line 563, in forward y, _ = self.model(im) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "/content/YOLOv6/yolov6/models/yolo.py", line 35, in forward x = self.backbone(x) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, kwargs) File "/content/YOLOv6/yolov6/models/efficientrep.py", line 107, in forward x = self.stem(x) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(args, kwargs) File "/content/YOLOv6/yolov6/layers/common.py", line 248, in forward return self.nonlinearity(self.se(self.rbr_reparam(inputs))) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py", line 460, in forward return self._conv_forward(input, self.weight, self.bias) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py", line 456, in _conv_forward return F.conv2d(input, weight, bias, self.stride, RuntimeError: Given groups=1, weight of size [32, 3, 3, 3], expected input[1, 1, 3, 416] to have 3 channels, but got 1 channels instead

Environment

Google Colab, Computer having Ubuntu 22.04 and Python 3.11

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?