MMdnn conversion

i’m using MMdnn for convert Tensorflow model to pytorch when i’m going to load the model i have this error
RuntimeError: Given groups=1, weight of size 9480 1024 1 1, expected input[1, 1, 1, 1024] to have 1024 channels, but got 1 channels instead

any solution for this error?

Your input seems to be created in a channels-last memory layout, while PyTorch expects channels-first tensors in the shape [batch_size, channels, height, width].
Assuming your current input has the shape [batch_size, height, width, channels] you could permute the input tensor via:

x = x.permute(0, 3, 1, 2)

I try but the problem is only for my output layer.If i’m going to change i the input i have this error

x = torch.randn(1,3, 224, 224)
x = x.permute(0, 3, 1, 2)

RuntimeError: Given groups=1, weight of size 32 3 3 3, expected input[1, 224, 4, 225] to have 3 channels, but got 224 channels instead

Your x tensor seems to have the correct shape.

I don’t quite understand the use case.
Are you using the model output in another convolution?

I found the solution through your help. It was an error of the badly converted network. Changed a data everything went well!