Why not convert checkpoint between PT and Paddle?
Why not convert checkpoint between PT and Paddle?
It's a burden to download twice.
Are their values different?
Because currently our ERNIEKit training code and the FastDeploy tool does not support loading PyTorch weights, we need to provide both Paddle and PyTorch model weights to ensure compatibility with different frameworks. The biggest difference between PyTorch and Paddle weights lies in the handling of linear layer weights β PyTorch stores Linear weights in [out_features, in_features] format, whereas Paddle uses [in_features, out_features], effectively requiring a transpose during conversion between the two. In the future, we plan to enhance ERNIEKit to support training directly from PyTorch weights as well.
I need to convert 0.36b ernie 4.5 paddle model to Pytorch to run it with Zero-Gpu there is only support for Ernie 3.0 conversion.
https://github.com/nghuyong/ERNIE-Pytorch.git
Will there be pytorch export option in Erniekit or there is a separate python script for conversion for 4.5 0.36b paddle model ?
pytorch compatabible ernie 4.5 0.3b model is also available in Hugging face.
If you are looking for the conversion scripts, check here:
https://github.com/PaddlePaddle/ERNIE/tree/develop/tools/paddle2torch