SavedModel export for DistilBERT is failing
Hi.I used the pre-trained weights of the DistilBERT model in order to train a text classification model with the SST-2 dataset. Now, when I am trying to export the trained model toSavedModelformat, it fails.Here’sthe full error trace.Here’s thenotebookfor the training code. I use the following lines of code in order to export the trained model toSavedModel-!mkdir DistilBERT
model.save("DistilBERT")
2020-10-09T03:12:01Z
Hi@sayakpaul,Where are you running this notebook, example, in Google Colab?
2020-10-09T03:31:49Z
Hi@Karthik12. I am running it on Kaggle as a kernel.
2020-10-09T04:17:00Z
Hi@sayakpaul, great to see you herethisnotebookmight help. It exportsTFDistilBertForQuestionAnsweringinSavedModelformat.
2020-10-09T06:06:02Z
Thank you,@valhalla. I will give it a check and update
2020-10-09T07:29:29Z
Looks like it was a silly incompatibility. With the GPU version of the same notebook (hyperparameters changed slightly), I was able to export the model toSavedModel. Does not look like a bug intransformers. Might be stemming from some incompatible Op within TensorFlow itself.
2020-10-09T08:34:07Z
Looking at the stack trace, I guess it’s because TPU strategy can only access GCS file system, which is why it’s throwingUnimplementedError: File system scheme '[local]' not implemented.Maybe pointing togs://address should allow export on TPU.Just a guess, not super familiar with TF.
2020-10-09T09:01:36Z
To be frank, huggingface support for Tensorflow is bare minimal. Its mostly focus on pytorch.
2020-10-09T09:02:09Z
Yeah definitely. But it’s possible to export a model locally that’s been trained in a TPU runtime.
2020-10-09T16:04:27Z
@sayakpaulIts not possible.