You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(paddle_env) iotmp@iotmp-PR4024ZY:/media/sdb3/PaddleOCR$ x2paddle --framework=onnx --model=/media/sdb3/rknn_model_zoo/models/vision/object_detection/yolov5-pytorch/yolov5/runs/capchat_20241202/exp4/weights/best.onnx --save_dir=./capchat/capchat_20241203_infer --enable_onnx_checker=true --input_shape_dict="{'image':[1, 3, 640, 640]}"
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/setuptools/command/easy_install.py:41: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
INFO:root:paddle.version = 2.4.0
INFO:root:Now translating model from onnx to paddle.
model ir_version: 4, op version: 9
Shape inferencing ...
Stopping at incomplete shape inference at Concat: x2paddle__model_12_Concat_output_0
node inputs:
name: "x2paddle__model_11_Upsample_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_param: "unk__0"
}
dim {
dim_param: "unk__1"
}
dim {
dim_param: "unk__2"
}
dim {
dim_param: "unk__3"
}
}
}
}
name: "x2paddle__model_6_cv3_act_Relu_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 256
}
dim {
dim_value: 40
}
dim {
dim_value: 40
}
}
}
}
node outputs:
name: "x2paddle__model_12_Concat_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
}
dim {
dim_param: "unk__1 + 256"
}
dim {
}
dim {
}
}
}
}
!!!!!!!!!!
Shape inferenced.
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/x2paddle/decoder/onnx_decoder.py:374: DeprecationWarning: mapping.TENSOR_TYPE_TO_NP_TYPE is now deprecated and will be removed in a future release.To silence this warning, please use helper.tensor_dtype_to_np_dtype instead.
TENSOR_TYPE_TO_NP_TYPE[item.type.tensor_type.elem_type],
Now, onnx2paddle support convert onnx model opset_verison [7, 8, 9, 10, 11, 12, 13, 14, 15], opset_verison of your onnx model is 9.
Total nodes: 150
Nodes converting ...
Converting node 1 ... /home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/x2paddle/decoder/onnx_decoder.py:172: DeprecationWarning: mapping.TENSOR_TYPE_TO_NP_TYPE is now deprecated and will be removed in a future release.To silence this warning, please use helper.tensor_dtype_to_np_dtype instead.
return TENSOR_TYPE_TO_NP_TYPE[dtype]
Converting node 2 ... /home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/x2paddle/decoder/onnx_decoder.py:175: DeprecationWarning: mapping.TENSOR_TYPE_TO_NP_TYPE is now deprecated and will be removed in a future release.To silence this warning, please use helper.tensor_dtype_to_np_dtype instead.
return TENSOR_TYPE_TO_NP_TYPE[dtype]
Converting node 276 ...
Nodes converted.
INFO:root:Model optimizing ...
INFO:root:Model optimized.
Exporting inference model from python code ('/media/sdb3/PaddleOCR/capchat/capchat_20241203_infer/x2paddle_code.py')...
In transformed code:
File "/media/sdb3/PaddleOCR/./capchat/capchat_20241203_infer/x2paddle_code.py", line 247, in forward
x2paddle__model_14_act_Relu_output_0 = self.relu39(x2paddle__model_14_conv_Conv_output_0)
x2paddle__model_11_Constant_output_0 = paddle.slice(input=x2paddle__model_11_Constant_output_0, axes=[0], starts=[2], ends=[4])
x2paddle__model_15_Upsample_output_0 = paddle.nn.functional.interpolate(x=x2paddle__model_14_act_Relu_output_0, scale_factor=x2paddle__model_11_Constant_output_0, mode='nearest', align_mode=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
x2paddle__model_16_Concat_output_0 = paddle.concat(x=[x2paddle__model_15_Upsample_output_0, x2paddle__model_4_cv3_act_Relu_output_0], axis=1)
x2paddle__model_17_cv1_conv_Conv_output_0 = self.conv44(x2paddle__model_16_Concat_output_0)
File "/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/nn/functional/common.py", line 698, in interpolate
helper.append_op(
File "/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/fluid/layer_helper.py", line 45, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/fluid/framework.py", line 4017, in append_op
op = Operator(
File "/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/fluid/framework.py", line 3016, in __init__
self.desc.infer_shape(self.block.desc)
ValueError: (InvalidArgument) Scale's shape must be 2 or 1, but got shape = 0 .
感谢您参与 X2Paddle 社区! 问题模版为了 X2Paddle 能更好的迭代,例如新功能发布、 RoadMaps 和错误跟踪. 😸
问题描述
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/setuptools/command/easy_install.py:41: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to
pkg_resources.declare_namespace('mpl_toolkits')
.Implementing implicit namespace packages (as specified in PEP 420) is preferred to
pkg_resources.declare_namespace
. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packagesdeclare_namespace(pkg)
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to
pkg_resources.declare_namespace('google')
.Implementing implicit namespace packages (as specified in PEP 420) is preferred to
pkg_resources.declare_namespace
. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packagesdeclare_namespace(pkg)
INFO:root:paddle.version = 2.4.0
INFO:root:Now translating model from onnx to paddle.
model ir_version: 4, op version: 9
Shape inferencing ...
Stopping at incomplete shape inference at Concat: x2paddle__model_12_Concat_output_0
node inputs:
name: "x2paddle__model_11_Upsample_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_param: "unk__0"
}
dim {
dim_param: "unk__1"
}
dim {
dim_param: "unk__2"
}
dim {
dim_param: "unk__3"
}
}
}
}
name: "x2paddle__model_6_cv3_act_Relu_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 256
}
dim {
dim_value: 40
}
dim {
dim_value: 40
}
}
}
}
node outputs:
name: "x2paddle__model_12_Concat_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
}
dim {
dim_param: "unk__1 + 256"
}
dim {
}
dim {
}
}
}
}
!!!!!!!!!!
Shape inferenced.
/home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/x2paddle/decoder/onnx_decoder.py:374: DeprecationWarning:
mapping.TENSOR_TYPE_TO_NP_TYPE
is now deprecated and will be removed in a future release.To silence this warning, please usehelper.tensor_dtype_to_np_dtype
instead.TENSOR_TYPE_TO_NP_TYPE[item.type.tensor_type.elem_type],
Now, onnx2paddle support convert onnx model opset_verison [7, 8, 9, 10, 11, 12, 13, 14, 15], opset_verison of your onnx model is 9.
Total nodes: 150
Nodes converting ...
Converting node 1 ... /home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/x2paddle/decoder/onnx_decoder.py:172: DeprecationWarning:
mapping.TENSOR_TYPE_TO_NP_TYPE
is now deprecated and will be removed in a future release.To silence this warning, please usehelper.tensor_dtype_to_np_dtype
instead.return TENSOR_TYPE_TO_NP_TYPE[dtype]
Converting node 2 ... /home/iotmp/anaconda3/envs/paddle_env/lib/python3.8/site-packages/x2paddle/decoder/onnx_decoder.py:175: DeprecationWarning:
mapping.TENSOR_TYPE_TO_NP_TYPE
is now deprecated and will be removed in a future release.To silence this warning, please usehelper.tensor_dtype_to_np_dtype
instead.return TENSOR_TYPE_TO_NP_TYPE[dtype]
Converting node 276 ...
Nodes converted.
INFO:root:Model optimizing ...
INFO:root:Model optimized.
Exporting inference model from python code ('/media/sdb3/PaddleOCR/capchat/capchat_20241203_infer/x2paddle_code.py')...
In transformed code:
[Hint: Expected scale_tensor_dim[0] == 2 || scale_tensor_dim[0] == 1 == true, but received scale_tensor_dim[0] == 2 || scale_tensor_dim[0] == 1:0 != true:1.] (at /paddle/paddle/phi/infermeta/multiary.cc:1514)
[operator < nearest_interp_v2 > error]
具体信息
onnx模型已经是去掉sacle_factor以及后处理部分,在转的是还会因为sacle_factor这个分支没有而报错,为什么呢,如何去掉呢
YOLOX:yolov5
边缘端的检测业务
PaddlePaddle => ❔ 2.4.2
X2Paddle => ❔ 1.5.0
来源框架版本(PyTorch/TF/ONNX/Caffe) => ❔
[email protected]
The text was updated successfully, but these errors were encountered: