-
Notifications
You must be signed in to change notification settings - Fork 162
[PyTorch2Paddle] nn.PReLU模型参数名不匹配 #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
感谢您的支持,您说的是预测模型还是训练代码转换,可以描述一下应用场景吗,感谢~ |
已经训练好的torch的模型参数(.pth)需要转成paddle的格式(.pdparams)。 具体可见: |
训练好的PyTorch模型转为Paddle参考文档:https://github.com/PaddlePaddle/X2Paddle/blob/develop/docs/inference_model_convertor/pytorch2paddle.md |
不是……这是报bug,不是求助贴,我已经转成功了;这个bug是用上面命令时遇到的,bug的内容就是转换后的模型参数(.pdparams)并不能直接load进转换后的paddle模型中,原因是nn.PReLU的可训练参数(param)在torch中定义为 |
如果直接在paddle里load转化后的model.pdparams,会报以下warning:
|
我的意思是您的命令使用错了,训练好的PyTorch模型转为Paddle需要参考文档:https://github.com/PaddlePaddle/X2Paddle/blob/develop/docs/inference_model_convertor/pytorch2paddle.md, |
😂 我的场景就是需要使用 |
发现了宝藏包!落地Paddle比想象中丝滑的多,非常感谢大家的辛苦付出!
模型来源: PyTorch
模型说明: 模型中使用了nn.PReLU,API映射表中表示功能一致,实际上他们保存的weight名称不一致。torch 中为 “weight",paddle中为"_weight"
The text was updated successfully, but these errors were encountered: