Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export onnx error #14

Open
MZener opened this issue Oct 19, 2021 · 3 comments
Open

export onnx error #14

MZener opened this issue Oct 19, 2021 · 3 comments

Comments

@MZener
Copy link

MZener commented Oct 19, 2021

微信截图_20211019093400

cuda11.1 + pytorch1.8 + cupy-cuda111, how to fix it, thanks a lot.
@QuietWoods
Copy link

根据test_aggregation_zeropad函数将aggregation_zeropad用torch api 实现,以下仅供参考:

def custom_aggregation_zeropad(input, weight, kernel_size=3, stride=1, padding=0, dilation=1):
    """
    自定义,用torch api实现
    """
    head_num = 2
    n, c_x, c_w, in_height, in_width = input.shape[0], input.shape[1], weight.shape[2], input.shape[-2], input.shape[-1]
    out_height = int((in_height + 2 * padding - (dilation * (kernel_size - 1) + 1)) / stride + 1)
    out_width = int((in_width + 2 * padding - (dilation * (kernel_size - 1) + 1)) / stride + 1)
    unfold_j = torch.nn.Unfold(kernel_size=kernel_size, dilation=dilation, padding=padding, stride=stride)
    x2 = unfold_j(input).view(n, c_x // c_w, c_w, pow(kernel_size, 2), out_height, out_width)
    y2 = (weight.unsqueeze(2) * x2.unsqueeze(1)).sum(-3).view(n, head_num * c_x, out_height, out_width)
    return y2

@YjDai
Copy link

YjDai commented Sep 28, 2022

后来这个问题解决了吗?我也是cuda11.1,相同的问题

@JustinNober
Copy link

俺也是

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants