Sorry to bother you. When I followed the guidance of change backbone to GhostNet, and I changed the chanel to channels = [40, 112, 160], which is the Ghostnet need, But it has error. Can you help me, many thanks!!!
RuntimeError: Given groups=1, weight of size [56, 224, 1, 1], expected input[2, 192, 40, 40] to have 224 channels, but got 192 channels instead
Traceback (most recent call last):
File "tools/train.py", line 115, in
main()
File "tools/train.py", line 111, in main
runner.train()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1686, in train
model = self.train_loop.run() # type: ignore
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 90, in run
self.run_epoch()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 106, in run_epoch
self.run_iter(idx, data_batch)
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 122, in run_iter
outputs = self.runner.model.train_step(
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 114, in train_step
losses = self._run_forward(data, mode='loss') # type: ignore
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 326, in _run_forward
results = self(data, mode=mode)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, *kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 92, in forward
return self.loss(inputs, data_samples)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/single_stage.py", line 77, in loss
x = self.extract_feat(batch_inputs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/single_stage.py", line 148, in extract_feat
x = self.neck(x)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, kwargs)
File "/root/Swin-Transformer-Object-Detection/mmyolo/mmyolo/models/necks/base_yolo_neck.py", line 242, in forward
inner_out = self.top_down_layers[len(self.in_channels) - 1 - idx](
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/container.py", line 141, in forward
input = module(input)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, *kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/layers/csp_layer.py", line 237, in forward
x_short = self.short_conv(x)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/cnn/bricks/conv_module.py", line 207, in forward
x = self.conv(x)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 446, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
Sorry to bother you. When I followed the guidance of change backbone to GhostNet, and I changed the chanel to channels = [40, 112, 160], which is the Ghostnet need, But it has error. Can you help me, many thanks!!!
RuntimeError: Given groups=1, weight of size [56, 224, 1, 1], expected input[2, 192, 40, 40] to have 224 channels, but got 192 channels instead
Traceback (most recent call last): File "tools/train.py", line 115, in
main()
File "tools/train.py", line 111, in main
runner.train()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1686, in train
model = self.train_loop.run() # type: ignore
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 90, in run
self.run_epoch()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 106, in run_epoch
self.run_iter(idx, data_batch)
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 122, in run_iter
outputs = self.runner.model.train_step(
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 114, in train_step
losses = self._run_forward(data, mode='loss') # type: ignore
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 326, in _run_forward
results = self(data, mode=mode)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, *kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 92, in forward
return self.loss(inputs, data_samples)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/single_stage.py", line 77, in loss
x = self.extract_feat(batch_inputs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/single_stage.py", line 148, in extract_feat
x = self.neck(x)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, kwargs)
File "/root/Swin-Transformer-Object-Detection/mmyolo/mmyolo/models/necks/base_yolo_neck.py", line 242, in forward
inner_out = self.top_down_layers[len(self.in_channels) - 1 - idx](
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/container.py", line 141, in forward
input = module(input)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, *kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/layers/csp_layer.py", line 237, in forward
x_short = self.short_conv(x)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/cnn/bricks/conv_module.py", line 207, in forward
x = self.conv(x)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 446, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,