lonePatient / NeZha_Chinese_PyTorch

NEZHA: Neural Contextualized Representation for Chinese Language Understanding
MIT License
261 stars 53 forks source link

checkpoint转pytorch问题 #2

Closed Fan9 closed 3 years ago

Fan9 commented 3 years ago

有几个问题请教下 1、公司网络无法下载某云盘资源,如何把huawei提供的checkpoint转成pytorch的bin文件。 2、转好后是否可以直接用transformers包加载使用

Fan9 commented 3 years ago

用convert_nezha_original_tf_checkpoint_to_pytorch.py已经转成功了,之前transformers版本低报了错。关于第二个问题请指教

lonePatient commented 3 years ago

@Fan9 只能用当前脚本进行加载,目前transformers还没收录nezha模型代码。

xiaotong-y commented 3 years ago

想请教一下,在用的时候遇到这个问题,要怎么解决? ValueError: Couldn't find 'checkpoint' file or checkpoints in given directory D:\juypter_notebook\NeZha_Chinese_PyTorch-main\pretrained_models 检查路径没有问题

lonePatient commented 3 years ago

@xiaotong-y 少一个checkpoint文件,tf转torch需要,可参考google提供的bert文件内容