PaddlePaddle / X2Paddle

Deep learning model converter for PaddlePaddle. (『飞桨』深度学习模型转换工具)
http://www.paddlepaddle.org/
Apache License 2.0
740 stars 165 forks source link

pytorch模型转paddle的过程中, aten::einsum不支持 #959

Open pupubushilulu opened 1 year ago

pupubushilulu commented 1 year ago

你好,我在使用x2paddle把stgcn的模型转成paddle的过程中报错,报错信息如下:

/X2Paddle/STGCN/Models.py:56: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). x = x.view(n, self.kernel_size, kc//self.kernel_size, t, v)

========= 1 OPs are not supported yet =========== ========== aten::einsum ============ Traceback (most recent call last): File "stgcn2paddle.py", line 32, in pytorch2paddle(module=model,save_dir=save_dir,jit_type=jit_type,input_examples=[data_tuple]) File "/home/wzp/anaconda3/envs/x2paddle/lib/python3.8/site-packages/x2paddle/convert.py", line 380, in pytorch2paddle mapper = PyTorchOpMapper(model) File "/home/wzp/anaconda3/envs/x2paddle/lib/python3.8/site-packages/x2paddle/op_mapper/pytorch2paddle/pytorch_op_mapper.py", line 41, in init raise Exception("Model is not supported yet.") Exception: Model is not supported yet. 需要安装paddlenlp吗?已安装,还是有报错

masteryi-0018 commented 1 year ago

我在我的仓库尝试添加了一个简单的版本,可以转换onnx的Einsum算子,目前只支持2个操作数,你可以根据需要再做一些修改:https://github.com/masteryi-0018/X2Paddle/pull/1