Can not convert the the custom trained BERT model to pytorch model for further use which should give me .bin file
# 📚 Migration

## Information

I pre trained a bert model from scratch with custom corpus and now want to use that model for further purpose like Qand A, masked word prediction etc. After pre- training I got below files:

bert_config.json bert_model.ckpt.data-00000-of-00001 bert_model.ckpt.index vocab.txt bert_model.ckpt.meta

Now , I need to convert the the model to pytorch model for further use which will give me .bin file . I am running below :+1: 



%cd /content/drive/My Drive/Anirban_test_pytorch/
!python convert_bart_original_pytorch_checkpoint_to_pytorch.py  "/content/drive/My Drive/Anirban_test_pytorch/model.ckpt.index" "/content/sample_data"\


But getting below error:

  File "convert_bart_original_pytorch_checkpoint_to_pytorch.py", line 75, in load_xsum_checkpoint
    sd = torch.load(checkpoint_path, map_location="cpu")
  File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 585, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 755, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '\x00'.

Please help me to fix the same.




Hello! It seems you're running the BART conversion script for a BERT model?<|||||>Yeah, but I got to fix this.
-Anirban

On Thu, 15 Oct, 2020, 2:52 PM Lysandre Debut, <notifications@github.com>
wrote:

> Hello! It seems you're running the BART conversion script for a BERT model?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/transformers/issues/7801#issuecomment-709032258>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AMTD2W4GWGTXTL5DFR3DHPDSK25O3ANCNFSM4SRMD3AQ>
> .
>
<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
