jiangjiajun / PaddleUtils

Some tools to operate PaddlePaddle model
Apache License 2.0
71 stars 26 forks source link

paddle与onnx兼容性问题 #4

Closed weirman closed 8 months ago

weirman commented 8 months ago

大佬好,我使用 paddle2onnx --input_shape_dict 出现

[WARNING] [Deprecated] The flag --input_shape_dict is deprecated, if you need to modify the input shape of PaddlePaddle model, please refer to this tool https://github.com/jiangjiajun/PaddleUtils/tree/main/paddle

所以打算使用paddle_infer_shape.py来解决这个问题,但是发现以下异常:

  File "paddle_infer_shape.py", line 54, in <module>
    import paddle.fluid as fluid
ModuleNotFoundError: No module named 'paddle.fluid'

查看后官方文档发现在paddle2.5的时候已经遗弃了paddle.fluid

这个问题大佬还会再跟进修复吗?以及--input_shape_dict动态输入是否有其他解决方案呢?

weirman commented 8 months ago

已解决,发现官方有解决方案,可能是 paddle2onnx 没有及时更改输出信息?

python -m paddle2onnx.optimize --input_model model.onnx \
                               --output_model new_model.onnx \
                               --input_shape_dict "{'x':[1,3,224,224]}"
happygb21 commented 4 weeks ago

paddle.fluid 请问如何解决