onnx.export报警告:WARNING: The shape inference of prim::Constant type is missing...解决方法
在将pytorch模型转换为onnx模型时报警:```WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic funct
·
在将pytorch模型转换为onnx模型时报警:
```
WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
```
经过模块尝试发现是`F.interpolate`函数(换成F.upsmple也报)导致的,下面给出两种解决方法:
方法1. 用反卷积代替上采样(只是猜测,未尝试)
方法2. 将onnx.export函数的属性加上opset_version=11。(我自己用的这个方法)
更多推荐
所有评论(0)