Error for MNN/source/shape/ShapeSqueeze.cpp, 80
What's wrong with the problem, I am new to MNN, I can only get this line but I know nothing about their meanings
MNN_ASSERT(squeezeDimSize< ib.dimensions);
The number of Squeeze parameter(squeeze dim) you specify should be less than the input dimension
The problem is that how to convert the following code, Can I make it?
def xcorr_depthwise(x, kernel):
"""depthwise cross correlation
"""
batch = kernel.size(0)
channel = kernel.size(1)
x = x.view(1, batch*channel, x.size(2), x.size(3))
kernel = kernel.view(batch*channel, 1, kernel.size(2), kernel.size(3))
out = F.conv2d(x, kernel, groups=batch*channel)
out = out.view(batch, channel, out.size(2), out.size(3))
return out
I try to solve it. It cost me much time to make it. I think the error info is helpless for me...
def xcorr_depthwise(x, kernel):
"""depthwise cross correlation
"""
batch = kernel.size(0)
channel = kernel.size(1)
kernel = kernel.squeeze(0).unsqueeze(1)
new_kernel = torch.rand(256,1, 5,5, device='cpu')
new_kernel.copy_(kernel)
out = F.conv2d(x, new_kernel, groups=256)
several places should be pointed out.
- view op is needed
- tensor size is very strange, Converter cannot get the correct size of tensor.
Please use netron to check the squeeze parameter in the onnx model. Put it in the below comment.
OK, I will read your source code to know more. Thanks all the same
你好,请问转换成mnn模型,xcorr_depthwise中的卷积操作,kernel参数可以传进去吗?