【问题标题】:pytorch to Onnx(OCR model)pytorch 到 Onnx(OCR 模型)
【发布时间】:2020-06-02 12:37:49
【问题描述】:

我正在尝试在给定的 repo https://github.com/clovaai/deep-text-recognition-benchmark 中转换 pytorch 模型 到onnx。

我在这样做时遇到了问题。

Failed to export an ONNX attribute 'onnx::Gather', since it's not constant, please try to make things (e.g., kernel size) static if possible

链接到 git 问题https://github.com/clovaai/deep-text-recognition-benchmark/issues/76

有什么建议吗?

谢谢。

【问题讨论】:

    标签: deep-learning computer-vision pytorch ocr onnx


    【解决方案1】:

    图层

    nn.AdaptiveAvgPool2d((None,1)).

    实际上没有导致错误;我们需要将其设为静态以解决错误。您可以将“无”更改为静态值。例如:

    nn.AdaptiveAvgPool2d((512,1)).

    【讨论】:

      【解决方案2】:

      adaptive_avg_pool2d 在我的情况下不受支持,并且这个 nn.AdaptiveAvgPool2d((None,1)) 也有问题。

      【讨论】:

        猜你喜欢
        • 2021-04-06
        • 2021-09-01
        • 2022-10-13
        • 2023-01-31
        • 2018-10-05
        • 2019-06-12
        • 2018-11-25
        • 2019-11-10
        • 2019-12-09
        相关资源
        最近更新 更多