Closed singhsidhukuldeep closed 3 years ago
Hey @singhsidhukuldeep,
Could you maybe upload your weights to a colab so that I can reproduce the error or upload your weights to the model hub and give me a path to it?
This way, I can reproduce the error and solve it :-)
Thanks a lot!
Hi @patrickvonplaten ,
I tried this
pt_model = TFBertForPreTraining.from_pretrained(model_output_location, from_pt=True)
print("\n\n>>> Saving HuggingFace to tensorflow(pb)")
tf.saved_model.save(pt_model,TF_model_output_location)
and it worked, but I am not able to understand the limitations here!
If you want to convert from TF to PT PT to TF this is exactly how you should to it...
@patrickvonplaten I am looking to convert PyTorch to TF!
Sorry I meant PT to TF -> your approach is correct here.
Got it! Thanks for the help.
One last thing, this gives a *.h5
file (weights only)
Is there a way to get *.pb
file with structure and weights?
Hi @singhsidhukuldeep, I tried this, it did save the model in assets, variables, and saved_model.pb format, but couldn't get any .h5 file that I need, am I missing something?
P.S. I am trying to convert a standard config BERT MaskedLM model
Hi @patrickvonplaten ,
I tried this
pt_model = TFBertForPreTraining.from_pretrained(model_output_location, from_pt=True) print("\n\n>>> Saving HuggingFace to tensorflow(pb)") tf.saved_model.save(pt_model,TF_model_output_location)
and it worked, but I am not able to understand the limitations here!
This issue has been automatically marked as stale and been closed because it has not had recent activity. Thank you for your contributions.
If you think this still needs to be addressed please comment on this thread.
Environment info
transformers
version: 3.5.1Who can help
I think: @patrickvonplaten @LysandreJik @VictorSanh
Anyone is welcome!
Information
Trying to convert my pytorch checkpoint to tf using the below code:
my model folder has a tiny bert trained using HuggingFace: contents of
model
folder are:checkpoint-500 special_tokens_map.json config.json tokenizer_config.json eval_results_mlm_wwm.txt training_args.bin pytorch_model.bin vocab.txt
To reproduce
Error:
Expected behavior