PaddlePaddle / Paddle2ONNX

ONNX Model Exporter for PaddlePaddle
Apache License 2.0
718 stars 166 forks source link

paddleslim量化之后,存在不支持OP,模型不能转化成onnx #568

Open ztfmars opened 2 years ago

ztfmars commented 2 years ago

请将下面信息填写完整,便于我们快速解决问题,谢谢!

问题描述 RT

报错截图

λ b8dcbef621aa /workspace/PaddleSeg {release/2.3} paddle2onnx --model_dir output_quant_infer \

--model_filename model.pdmodel \ --params_filename model.pdiparams \ --opset_version 11 \ --save_file output_onnx/deeplabv3_int.onnx grep: warning: GREPOPTIONS is deprecated; please use an alias or script /usr/local/lib/python3.7/dist-packages/onnx/mapping.py:27: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations int(TensorProto.STRING): np.dtype(np.object) /usr/local/lib/python3.7/dist-packages/paddle2onnx/constant/dtypes.py:45: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.boolhere. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations np.bool: core.VarDesc.VarType.BOOL, /usr/local/lib/python3.7/dist-packages/paddle2onnx/constant/dtypes.py:46: DeprecationWarning:np.floatis a deprecated alias for the builtinfloat. To silence this warning, usefloatby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.float64here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations core.VarDesc.VarType.FP32: np.float, /usr/local/lib/python3.7/dist-packages/paddle2onnx/constant/dtypes.py:51: DeprecationWarning:np.boolis a deprecated alias for the builtinbool. To silence this warning, useboolby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.bool_` here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations core.VarDesc.VarType.BOOL: np.bool Traceback (most recent call last): File "/usr/local/bin/paddle2onnx", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/command.py", line 184, in main input_shape_dict=input_shape_dict) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/command.py", line 148, in program2onnx operator_export_type=operator_export_type) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/convert.py", line 84, in program2onnx enable_onnx_checker, operator_export_type) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/convert.py", line 34, in export_onnx operator_export_type, verbose) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/graph/onnx_graph.py", line 240, in build onnx_graph = ONNXGraph(paddle_graph, opset_version=opset_version, operator_export_type=operator_export_type) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/graph/onnx_graph.py", line 79, in init self.update_opset_version() File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/graph/onnx_graph.py", line 194, in update_opset_version self.opset_version = OpMapper.get_recommend_opset_version(node_map, self.opset_version) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/op_mapper/op_mapper.py", line 129, in get_recommend_opset_version node_map, opset_version, True) File "/usr/local/lib/python3.7/dist-packages/paddle2onnx/op_mapper/op_mapper.py", line 174, in check_support_status raise NotImplementedError(error_info) NotImplementedError: There's 2 ops are not supported yet =========== fake_channel_wise_quantize_dequantize_abs_max =========== =========== fake_quantize_dequantize_moving_average_abs_max ===========

其他信息

yeliang2258 commented 2 years ago

您好,请使用这个PR进行转换测试:https://github.com/PaddlePaddle/Paddle2ONNX/pull/399

yeliang2258 commented 2 years ago

另外,方便的话,麻烦抽出半分钟时间帮我们完成一个Paddle2ONNX的调研问卷:https://iwenjuan.baidu.com/?code=r8hu2s 谢谢!

justld commented 2 years ago

您好,请问https://github.com/PaddlePaddle/Paddle2ONNX/pull/399大概什么时候可以合入呢。

yeliang2258 commented 2 years ago

最近正在对代码进行整理,预计3月底可以合入