Skip to content
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

Pytorch模型 #4

Open
jiangix01 opened this issue Sep 26, 2019 · 4 comments
Open

Pytorch模型 #4

jiangix01 opened this issue Sep 26, 2019 · 4 comments

Comments

@jiangix01
Copy link

您好,可以麻烦提供Pytorch版本吗?目前在使用pytorch transformer转化时出错了。后续可以跟您报告我们模型在使用xlnet模型做情感分类(CCF BDCI)的准确率,谢谢

@Splendon
Copy link

你解决转化的问题没有啦

@Splendon
Copy link

我用这行命令
python pytorch_transformers/convert_xlnet_checkpoint_to_pytorch.py --tf_checkpoint_path XLNet_zh_Large_L-24_H-1024_A-16/xlnet_model.ckpt --xlnet_config_file XLNet_zh_Large_L-24_H-1024_A-16/xlnet_config.json --pytorch_dump_folder_path XLNet_zh_Large_L-24_H-1024_A-16
而且,把xlnet_model.ckpt改名为xlnet_model.ckpt.data-00000-of-00001,就可以顺利转换了

@jiangix01
Copy link
Author

我用这行命令
python pytorch_transformers/convert_xlnet_checkpoint_to_pytorch.py --tf_checkpoint_path XLNet_zh_Large_L-24_H-1024_A-16/xlnet_model.ckpt --xlnet_config_file XLNet_zh_Large_L-24_H-1024_A-16/xlnet_config.json --pytorch_dump_folder_path XLNet_zh_Large_L-24_H-1024_A-16
而且,把xlnet_model.ckpt改名为xlnet_model.ckpt.data-00000-of-00001,就可以顺利转换了

谢谢谢谢,我这边还是会报错,看了一下可能是pytorch_transformers已经更新了,所以这条命令会报错,如果您方便的话可以麻烦将您用于转化的pytorch_transformers文件夹发给我一下吗?真的非常感谢~我的邮箱是jiangix321@163.com

@HikaruSama233
Copy link

HikaruSama233 commented Oct 18, 2019

是tensorflow的问题。具体的做法是用这个命令

python pytorch_transformers/convert_xlnet_checkpoint_to_pytorch.py --tf_checkpoint_path XLNet_zh_Large_L-24_H-1024_A-16/xlnet_model --xlnet_config_file XLNet_zh_Large_L-24_H-1024_A-16/xlnet_config.json --pytorch_dump_folder_path XLNet_zh_Large_L-24_H-1024_A-16

同时把xlnet_model.ckpt改名为xlnet_model.data-00000-of-00001,就是把ckpt去掉,这样tensorflow在读xlnet_model的时候会自动去找xlnet_model.data-00000-of-00001,xlnet_model.index,xlnet_model.meta这三个文件,然后就可以顺利转换了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants