How to export/save a text classifier after fine-tuned on a pre-trained BERTHow to train a set of images (apart form the tutorial) and use it to classify in Tensorflow?How to export a trained model from tensorflow and how correctly to import in opencv dnn?Export Tensorflow EstimatorHow to feed input into one layer in a tensorflow pre-trained model?TypeError: __init__() missing 2 required positional arguments: 'message' and 'code'how to solve the no 'estimator' in tensorflow?Converting Tensorflow Graph to use Estimator, get 'TypeError: data type not understood' at loss function using `sampled_softmax_loss` or `nce_loss`Tensorflow Estimator causes 'data type not understood' error at `sampled_softmax_loss` or `nce_loss` for Tensorflow's official word2vec implementationTensor conversion requested dtype int32 for Tensor with dtype int64 - while estimator.export_savedmodelSaving a custom tf.estimator trained model for tensorflow serving

How dangerous are my worn rims?

Single tx included in two different blocks

Generating numbers with cubes

Job interview by video at home and privacy concerns

The answer is a girl's name (my future granddaughter) - can anyone help?

Why did they use ultrafast diodes in a 50 or 60 Hz bridge?

French license plates

Why has Speaker Pelosi been so hesitant to impeach President Trump?

Is there a way to make an animal companion able to read a language?

Giving a good fancy look to a simple table

What does a textbook look like while you are writing it?

Avoiding dust scattering when you drill

How to level a picture frame hung on a single nail?

Ĉi tie or ĉi-tie? Why do people sometimes hyphenate ĉi tie?

Rank-one positive decomposition for a entry-wise positive positive definite matrix

Do jackscrews suffer from blowdown?

Citing CPLEX 12.9

Everyone Gets a Window Seat

IEEE 754 square root with Newton-Raphson

Would a horse be sufficient buffer to prevent injury when falling from a great height?

Parent asking for money after I moved out

Bothered by watching coworkers slacking off

Re-entering the UK after overstaying in 2008

Could Boris Johnson face criminal charges for illegally proroguing Parliament?



How to export/save a text classifier after fine-tuned on a pre-trained BERT


How to train a set of images (apart form the tutorial) and use it to classify in Tensorflow?How to export a trained model from tensorflow and how correctly to import in opencv dnn?Export Tensorflow EstimatorHow to feed input into one layer in a tensorflow pre-trained model?TypeError: __init__() missing 2 required positional arguments: 'message' and 'code'how to solve the no 'estimator' in tensorflow?Converting Tensorflow Graph to use Estimator, get 'TypeError: data type not understood' at loss function using `sampled_softmax_loss` or `nce_loss`Tensorflow Estimator causes 'data type not understood' error at `sampled_softmax_loss` or `nce_loss` for Tensorflow's official word2vec implementationTensor conversion requested dtype int32 for Tensor with dtype int64 - while estimator.export_savedmodelSaving a custom tf.estimator trained model for tensorflow serving






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









5















I followed the steps on the Predicting Movie Reviews with BERT on TF Hub here: https://colab.research.google.com/github/google-research/bert/blob/master/predicting_movie_reviews_with_bert_on_tf_hub.ipynb#scrollTo=PPVEXhNjYXC-.



At the end, how do I export the model to be used/loaded as a classifier later?



I found a link (https://guillaumegenthial.github.io/serving-tensorflow-estimator.html) that shows that I can export the estimator as a tf.saved_model. However, I got stuck on creating the 'serving_input_receiver_fn()'.










share|improve this question
























  • What about using pickle to serialize it?

    – Alberto Bonsanto
    Mar 28 at 21:19











  • @AlbertoBonsanto Thanks for your input. Could you elaborate on that? Do you mean dump the 'estimator' using pickle?

    – ebaik
    Mar 29 at 15:55











  • any luck on this? i am stuck in same situation?

    – Upasana Mittal
    Jul 28 at 4:23

















5















I followed the steps on the Predicting Movie Reviews with BERT on TF Hub here: https://colab.research.google.com/github/google-research/bert/blob/master/predicting_movie_reviews_with_bert_on_tf_hub.ipynb#scrollTo=PPVEXhNjYXC-.



At the end, how do I export the model to be used/loaded as a classifier later?



I found a link (https://guillaumegenthial.github.io/serving-tensorflow-estimator.html) that shows that I can export the estimator as a tf.saved_model. However, I got stuck on creating the 'serving_input_receiver_fn()'.










share|improve this question
























  • What about using pickle to serialize it?

    – Alberto Bonsanto
    Mar 28 at 21:19











  • @AlbertoBonsanto Thanks for your input. Could you elaborate on that? Do you mean dump the 'estimator' using pickle?

    – ebaik
    Mar 29 at 15:55











  • any luck on this? i am stuck in same situation?

    – Upasana Mittal
    Jul 28 at 4:23













5












5








5








I followed the steps on the Predicting Movie Reviews with BERT on TF Hub here: https://colab.research.google.com/github/google-research/bert/blob/master/predicting_movie_reviews_with_bert_on_tf_hub.ipynb#scrollTo=PPVEXhNjYXC-.



At the end, how do I export the model to be used/loaded as a classifier later?



I found a link (https://guillaumegenthial.github.io/serving-tensorflow-estimator.html) that shows that I can export the estimator as a tf.saved_model. However, I got stuck on creating the 'serving_input_receiver_fn()'.










share|improve this question














I followed the steps on the Predicting Movie Reviews with BERT on TF Hub here: https://colab.research.google.com/github/google-research/bert/blob/master/predicting_movie_reviews_with_bert_on_tf_hub.ipynb#scrollTo=PPVEXhNjYXC-.



At the end, how do I export the model to be used/loaded as a classifier later?



I found a link (https://guillaumegenthial.github.io/serving-tensorflow-estimator.html) that shows that I can export the estimator as a tf.saved_model. However, I got stuck on creating the 'serving_input_receiver_fn()'.







python tensorflow tensorflow-estimator






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 21:16









ebaikebaik

263 bronze badges




263 bronze badges















  • What about using pickle to serialize it?

    – Alberto Bonsanto
    Mar 28 at 21:19











  • @AlbertoBonsanto Thanks for your input. Could you elaborate on that? Do you mean dump the 'estimator' using pickle?

    – ebaik
    Mar 29 at 15:55











  • any luck on this? i am stuck in same situation?

    – Upasana Mittal
    Jul 28 at 4:23

















  • What about using pickle to serialize it?

    – Alberto Bonsanto
    Mar 28 at 21:19











  • @AlbertoBonsanto Thanks for your input. Could you elaborate on that? Do you mean dump the 'estimator' using pickle?

    – ebaik
    Mar 29 at 15:55











  • any luck on this? i am stuck in same situation?

    – Upasana Mittal
    Jul 28 at 4:23
















What about using pickle to serialize it?

– Alberto Bonsanto
Mar 28 at 21:19





What about using pickle to serialize it?

– Alberto Bonsanto
Mar 28 at 21:19













@AlbertoBonsanto Thanks for your input. Could you elaborate on that? Do you mean dump the 'estimator' using pickle?

– ebaik
Mar 29 at 15:55





@AlbertoBonsanto Thanks for your input. Could you elaborate on that? Do you mean dump the 'estimator' using pickle?

– ebaik
Mar 29 at 15:55













any luck on this? i am stuck in same situation?

– Upasana Mittal
Jul 28 at 4:23





any luck on this? i am stuck in same situation?

– Upasana Mittal
Jul 28 at 4:23












0






active

oldest

votes













Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406968%2fhow-to-export-save-a-text-classifier-after-fine-tuned-on-a-pre-trained-bert%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406968%2fhow-to-export-save-a-text-classifier-after-fine-tuned-on-a-pre-trained-bert%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript