Skip to content

EfficientVit export to onnx #261

@cebain

Description

@cebain

when I try to export the trained .pth to onnx, it keeps raising error like below, but I can't find any use of adaptive_avg_pool2d in the model, how can i solve this?
torch.onnx.errors.SymbolicValueError: Unsupported: ONNX export of operator adaptive_avg_pool2d, input size not accessible. Please feel free to request support or submit a pull request on PyTorch GitHub: https://github.com/pytorch/pytorch/issues [Caused by the value 'input.1332 defined in (%input.1332 : Float(*, *, *, *, strides=[65536, 256, 16, 1], requires_grad=1, device=cuda:0) = onnx::Add(%input.1312, %3697), scope: model.effientNet.UnetVitUPer::/efficientViT.efficientvit4.EfficientViT::encoder/torch.nn.modules.container.Sequential::blocks4/efficientViT.efficientvit4.EfficientViTBlock::blocks4.4/efficientViT.efficientvit4.Residual::ffn1 # /home/adminroot/Documents/ccc/pycharmProjects/tinyUPerNET/efficientViT/efficientvit4.py:108:0
)' (type 'Tensor') in the TorchScript graph. The containing node has kind 'onnx::Add'.]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions