Open johnny-brav0 opened 2 years ago
Currently, after running the
run_pretraining.py
the model checkpoints get saved. But is there any way I can save the entire model as amodel.pb
file so that in future it could be loaded directly as aKerasLayer
withtf_hub
?Or is there a way of loading
model.ckpt
as aKerasLayer
?Please let me know if there is a way to do either. It'd be very helpful.
Thanks.
I don't know the way for converting it to a model.pb, but for the people that find this issue. You can use https://huggingface.co/docs/transformers/converting_tensorflow_models to convert tensorflow checkpoints into pytorch_model.bin
@theProcrastinatr I think you can do like this
!mkdir -p saved_model model.save('saved_model/my_model')
ls saved_model
ls saved_model/my_model
Currently, after running the
run_pretraining.py
the model checkpoints get saved. But is there any way I can save the entire model as amodel.pb
file so that in future it could be loaded directly as aKerasLayer
withtf_hub
?Or is there a way of loading
model.ckpt
as aKerasLayer
?Please let me know if there is a way to do either. It'd be very helpful.
Thanks.
Currently, after running the
run_pretraining.py
the model checkpoints get saved. But is there any way I can save the entire model as amodel.pb
file so that in future it could be loaded directly as aKerasLayer
withtf_hub
?Or is there a way of loading
model.ckpt
as aKerasLayer
?Please let me know if there is a way to do either. It'd be very helpful.
Thanks.