Replies: 1 comment
-
I think I partially found the cause - but it didn't fix the chain. I didn't knew it was still working with a batch at that point of the tool chain, which I think is the case because of similar discussions. After the last transform in the pipeline I have a (6,240,320)-tensor, but a (1,6,240,320)-tensor is stored as data in single_gpu_test (probably due to MultiScaleFlipAug?). Is the additional dimension for the batch-shape? In my own custom forward-function I squeezed this dimension (currently only testing with a single image in the cfg-file and the labels-file, therefore no actual batch, but a batch-size per gpu of 2). But when changing it to preserve the batch-dimension I get a TypeError:
Output:
Error-message:
|
Beta Was this translation helpful? Give feedback.
-
I have a customized model. In the forward-function I separate a (6,240,320) tensor (2 modals of images) into 2 tensors and forward them to two branches, each being a ResNet50. Each forwarded tensor has a size of (3,240,320) as planned.
But I get this Runtime Error right after it in the forward-chain:
RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 3-dimensional input of size [3, 240, 320] instead
The test_pipeline I use is shortened to this:
Is another one of the transforms necessary to get the requested input in the first layer of ResNet? Or what else might be the cause?
The complete error-message from the custom-forward-function onwards:
Beta Was this translation helpful? Give feedback.
All reactions