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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Given groups=1, weight of size [48, 3, 3, 3], expected input[2, 640, 640, 640] to have 3 channels, but got 640 channels instead #1989

Open
qqqtwh opened this issue May 10, 2024 · 0 comments

Comments

@qqqtwh
Copy link

qqqtwh commented May 10, 2024

馃挕 Your Question

Traceback (most recent call last):
File "train.py", line 234, in
trainer.train(
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/super_gradients/training/sg_trainer/sg_trainer.py", line 1530, in train
train_metrics_tuple = self._train_epoch(context=context, silent_mode=silent_mode)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/super_gradients/training/sg_trainer/sg_trainer.py", line 504, in _train_epoch
outputs = self.net(inputs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/super_gradients/training/models/detection_models/customizable_detector.py", line 93, in forward
x = self.backbone(x)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/super_gradients/modules/detection_modules.py", line 86, in forward
x = getattr(self, layer)(x)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/super_gradients/training/models/detection_models/yolo_nas/yolo_stages.py", line 174, in forward
return self.conv(x)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/super_gradients/modules/qarepvgg_block.py", line 196, in forward
x_3x3 = self.branch_3x3(inputs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/container.py", line 217, in forward
input = module(input)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/envs/sg371/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 460, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/opt/conda/envs/sg371/lib/python3.8/site-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 [48, 3, 3, 3], expected input[2, 640, 640, 640] to have 3 channels, but got 640 channels instead

=====================================
Package Version


absl-py 2.1.0
alabaster 0.7.13
albumentations 1.3.1
antlr4-python3-runtime 4.9.3
arabic-reshaper 3.0.0
asn1crypto 1.5.1
attrs 23.2.0
Babel 2.15.0
backports.zoneinfo 0.2.1
boto3 1.34.102
botocore 1.34.102
build 1.2.1
cachetools 5.3.3
certifi 2024.2.2
cffi 1.16.0
charset-normalizer 3.3.2
click 8.1.7
coloredlogs 15.0.1
contourpy 1.1.1
coverage 5.3.1
cryptography 42.0.7
cssselect2 0.7.0
cycler 0.12.1
data-gradients 0.3.2
Deprecated 1.2.14
docutils 0.17.1
einops 0.3.2
filelock 3.14.0
flatbuffers 24.3.25
fonttools 4.51.0
fsspec 2024.3.1
future 1.0.0
google-auth 2.29.0
google-auth-oauthlib 1.0.0
grpcio 1.63.0
html5lib 1.1
humanfriendly 10.0
hydra-core 1.3.2
idna 3.7
imagededup 0.3.2
imageio 2.34.1
imagesize 1.4.1
importlib_metadata 7.1.0
importlib_resources 6.4.0
Jinja2 3.1.4
jmespath 1.0.1
joblib 1.4.2
json-tricks 3.16.1
jsonschema 4.22.0
jsonschema-specifications 2023.12.1
kiwisolver 1.4.5
lazy_loader 0.4
lxml 5.2.1
Markdown 3.6
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.7.5
mdurl 0.1.2
mpmath 1.3.0
networkx 3.1
numpy 1.23.0
nvidia-cublas-cu12 12.1.3.1
nvidia-cuda-cupti-cu12 12.1.105
nvidia-cuda-nvrtc-cu12 12.1.105
nvidia-cuda-runtime-cu12 12.1.105
nvidia-cudnn-cu12 8.9.2.26
nvidia-cufft-cu12 11.0.2.54
nvidia-curand-cu12 10.3.2.106
nvidia-cusolver-cu12 11.4.5.107
nvidia-cusparse-cu12 12.1.0.106
nvidia-nccl-cu12 2.20.5
nvidia-nvjitlink-cu12 12.4.127
nvidia-nvtx-cu12 12.1.105
oauthlib 3.2.2
omegaconf 2.3.0
onnx 1.15.0
onnxruntime 1.15.0
onnxsim 0.4.36
opencv-python 4.8.1.78
opencv-python-headless 4.8.1.78
oscrypto 1.3.0
packaging 24.0
pandas 2.0.3
pillow 10.3.0
pip 24.0
pip-tools 7.4.1
pkgutil_resolve_name 1.3.10
platformdirs 4.2.1
protobuf 3.20.3
psutil 5.9.8
pyasn1 0.6.0
pyasn1_modules 0.4.0
pycparser 2.22
pyDeprecate 0.3.2
Pygments 2.18.0
pyHanko 0.25.0
pyhanko-certvalidator 0.26.3
pyparsing 3.1.2
pypdf 4.2.0
pypng 0.20220715.0
pyproject_hooks 1.1.0
python-bidi 0.4.2
python-dateutil 2.9.0.post0
pytz 2024.1
PyWavelets 1.4.1
PyYAML 6.0.1
qrcode 7.4.2
qudida 0.0.4
rapidfuzz 3.9.0
referencing 0.35.1
reportlab 3.6.13
requests 2.31.0
requests-oauthlib 2.0.0
rich 13.7.1
rpds-py 0.18.1
rsa 4.9
s3transfer 0.10.1
scikit-image 0.21.0
scikit-learn 1.3.2
scipy 1.10.1
seaborn 0.13.2
setuptools 69.5.1
six 1.16.0
snowballstemmer 2.2.0
Sphinx 4.0.3
sphinx-rtd-theme 1.3.0
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.1
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
stringcase 1.2.0
super-gradients 3.7.1
svglib 1.5.1
sympy 1.12
tensorboard 2.14.0
tensorboard-data-server 0.7.2
termcolor 1.1.0
threadpoolctl 3.5.0
tifffile 2023.7.10
tinycss2 1.3.0
tomli 2.0.1
torch 2.3.0
torchmetrics 0.8.0
torchvision 0.18.0
tqdm 4.66.4
treelib 1.6.1
triton 2.3.0
typing_extensions 4.11.0
tzdata 2024.1
tzlocal 5.2
uritools 4.0.2
urllib3 1.26.18
webencodings 0.5.1
Werkzeug 3.0.3
wheel 0.43.0
wrapt 1.16.0
xhtml2pdf 0.2.11
zipp 3.18.1

============================

img_size = [640, 640]

transforms_none = [
    {'DetectionPaddedRescale': {'input_dim': img_size, 'max_targets': 120}},
    {'DetectionTargetsFormatTransform': {'input_dim': img_size, 'output_format': 'LABEL_CXCYWH'}}
]

transforms_aug = [
    {'DetectionMosaic': {'input_dim': img_size, 'prob': 0.5}},
    {'DetectionMixup': {'input_dim': img_size, 'mixup_scale': [0.5, 1.5], 'prob': 0.5, 'flip_prob': 0.5}},
    {'DetectionHorizontalFlip': {'prob': 0.5}},  
    {'DetectionHSV': {'prob': 0.5, 'hgain': 0.5, 'sgain': 0.5, 'vgain': 0.5}},
    {'DetectionPaddedRescale': {'input_dim': img_size, 'max_targets': 120}},
    {'DetectionTargetsFormatTransform': {'input_dim': img_size, 'output_format': 'LABEL_CXCYWH'}},
    {'DetectionRandomRotate90': {'prob': -0.5}}, 
    {'DetectionPadToSize': {'output_size': img_size, 'pad_value': 114}}

Versions

No response

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

1 participant