-
第一步
https://huggingface.co/transformers/converting_tensorflow_models.html
pip install transformers
下载完成后:
-
第二步
转到:https://github.com/huggingface/transformers/blob/master/examples/text-classification/run_glue.py
下载这个文本到Bert文件中,并在该文件下做出下面指令(记得替换自己的路径):
python convert_tf_checkpoint_to_pytorch.py --tf_checkpoint_path D:\路径\chinese_L-12_H-768_A-12\bert_model.ckpt --bert_config_file D:\路径\chinese_L-12_H-768_A-12\bert_config.json --pytorch_dump_path D:\路径\chinese_L-12_H-768_A-12\pytorch_model.bin
成功后: