Open VanLinLin opened 11 months ago
@VanLinLin The configuration seems fine. I suspect there might be an error in your "InternImage" code.
@hhaAndroid Hi, thanks for your reply. I'm finished migrating InternImage into mmdetection3, that's pretty cool and thank you again!
@VanLinLin What changes did you make to make it run in v3 of mmdetection? I only have one mmdetection repo with version 3.X, so i want to know that how hard is it to change the source code
I'm having the same problem. The batch_size information is done list-wise while conv2d expects the item to be a tensor of shape (B, C, H, W)
. Instead we have a list of tensors of shape (C, H, W)
:
TypeError: conv2d() received an invalid combination of arguments - got (list, Parameter, NoneType, tuple, tuple, tuple, int), but expected one of:
* (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)
didn't match because some of the arguments have invalid types: (list of [Tensor, Tensor], Parameter, NoneType, tuple of (int, int), tuple of (int, int), tuple of (int, int), int)
* (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)
didn't match because some of the arguments have invalid types: (list of [Tensor, Tensor], Parameter, NoneType, tuple of (int, int), tuple of (int, int), tuple of (int, int), int)
Here I have a batch size of 2
("list of [Tensor, Tensor]")
Solution found in this issue
It seams that you have to specify the collate_fn
in your dataloader config :
train_dataloader = dict(
batch_size=2, # Batch size of a single GPU
num_workers=2, # Worker to pre-fetch data for each single GPU
persistent_workers=True,
collate_fn=dict(type="default_collate"),
....
)
Describe the issue
I'm migrating the InternImage backbone into mmdetection 3 from InternImage repo(it's built by mmdetection 2.28), it's almost done. However, when I try to train the model, it occurred some error and I can't figure out what happened.
Reproduction
Environment
Results
Issue fix