Open Radeeswar opened 5 years ago
Yes, even I am facing the same issue.
has anybody solved this problem? pls,help me ,3q
Try exporting the model. We get saved_model and variables. Use it for predictions. Check the below issue to export or even tensorflow . https://github.com/google-research/bert/issues/146
@Radeeswar Hi, i'm wondering have you solved the performance issue? seems like post-process takes most of the time(predict only takes less than 1s), the iteration over whole features and examples cost too much. Please let me know if there's anyway we can bypass... Appreciate!
@Radeeswar Hi, i'm wondering have you solved the performance issue? seems like post-process takes most of the time(predict only takes less than 1s), the iteration over whole features and examples cost too much. Please let me know if there's anyway we can bypass... Appreciate!
Hey @SherL0cked , Firstly the performance is better not too good. And the thing is once we export saved model then try to remove unnecessary steps in post processing and I used the below to load saved model. ---> tensorflow.contrib import predictor ----> predictor.from_saved_model(model) Example of removing steps like: Squad predicts 20 outputs for a input so reducing helps based on requrements. Ty!
@Radeeswar ! That's pretty what I'm doing right now, as I'm working on a chatbot to answer the question in a long context, so I manually merged examples.doc_tokens from read_squad_examples and increased seq length, it works good so far. Thanks again for answering!
@SherL0cked, any chance you can share insight on token length limit(512). If the input is much longer, how to process? I am thinking to break down input, but probably not sensible, because each chunk produces an answer, and correct answer can have low score than wrong answer.
I successfully save the model follow this ,but when I try to predict the answer , I got the error ValueError: Cannot feed value of shape (1,) for Tensor 'input_example_tensor:0', which has shape '(8,)' Anyone can help
How to use bert-squad model to predict fastly or how to load once and predict multiple inputs.(Since it takes 25-30 sec for one single input)