Paddle2ONNX
Paddle2ONNX copied to clipboard
mobileseg_shufflenetv2 导出报错
Please fill in the information below so that we can solve the problem quickly, Thanks !
Describe the bug
A clear and concise description of what the bug is.
W0228 17:40:05.151883 24972 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.4, Runtime API Version: 11.1
W0228 17:40:05.173039 24972 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2.
2023-02-28 17:40:07 [INFO] Loading pretrained model from https://paddleseg.bj.bcebos.com/dygraph/backbone/shufflenetv2_x1_0.zip
2023-02-28 17:40:07 [INFO] There are 275/275 variables loaded into ShuffleNet.
2023-02-28 17:40:07 [INFO] Loaded trained params of model successfully.
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle/fluid/layers/math_op_patch.py:336: UserWarning: /tmp/tmpp9nemwh5.py:26
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
warnings.warn(
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle/fluid/layers/math_op_patch.py:336: UserWarning: /tmp/tmp6zud28gx.py:7
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
warnings.warn(
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle/fluid/layers/math_op_patch.py:336: UserWarning: /tmp/tmpgrc0jysf.py:7
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
warnings.warn(
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle/fluid/layers/math_op_patch.py:336: UserWarning: /tmp/tmp5mcont17.py:7
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
warnings.warn(
2023-02-28 17:40:11 [INFO] Model is saved in ./output/mobilennetv3_psphead__256x256_80k/.
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle2onnx/constant/dtypes.py:47: 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.bool_
here.
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,
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle2onnx/constant/dtypes.py:48: DeprecationWarning: np.float
is a deprecated alias for the builtin float
. To silence this warning, use float
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64
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.FP32: np.float,
/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle2onnx/constant/dtypes.py:53: 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.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 "/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle2onnx/op_mapper/op_mapper.py", line 119, in mapping
mapper_func(graph, node, **kw)
File "/home/dell/anaconda3/envs/bagtorch/lib/python3.8/site-packages/paddle2onnx/op_mapper/nn.py", line 167, in opset_1
raise Exception(
Exception: Converting this model to ONNX need with static input shape, please fix input shape of this model, see doc Q2 in https://github.com/PaddlePaddle/paddle2onnx/blob/develop/docs/en/FAQ.md.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dell/anaconda3/envs/bagtorch/bin/paddle2onnx", line 8, in
请参考:https://github.com/PaddlePaddle/paddle2onnx/blob/develop/docs/en/FAQ.md 先固定住模型的shape之后再进行导出
我每次导出都使用了input_shape去固定输入,但是实际上这次好像并没有生效,转化直接失败了
@yeliang2258 ,我将形状进行固定了输入的shape,但是似乎它的形状推断到了这个位置下面没有办法推断,不知道是哪里出现了问题,我想知道这个是可以正常转化的标准配置吗?
类似于这样它在这个位置,没有办法正常推断了。
我也碰到类似的问题,这个问题解决了吗