Restore model each time doing estimator.predict
I am using the code from extract_features.py . I called model_fn_builder only once. And create several examples list to feed to estimator.predict . It seems that each time doing estimator.predict, the model is restored which can be seen from the logger info. This slows down. Where can I fix this?
I think that's the expected behavior of this interface, so if you need different behavior you can change the interface to something other than TPUEstimator.
@mfxss I solved this problem in this repo, and wrap the extract_features as a service. please refer to it: https://github.com/hanxiao/bert-as-service
the avg. speed for 12 layer BERT with max_seq_len is about 2000 sample/s
@hanxiao I solved this problem in this repo, and wrap the extract_features as a service. please refer to it: https://github.com/hanxiao/bert-as-service the avg. speed for 12 layer BERT with
max_seq_lenis about 2000 sample/s 韩: Where did you modify to achieve this? Only in extract_feature.py? Thanks for the help!
@mfxss I solved this problem in this repo, and wrap the extract_features as a service. please refer to it: https://github.com/hanxiao/bert-as-service the avg. speed for 12 layer BERT with
max_seq_lenis about 2000 sample/s
@mfxss I solved this problem in this repo, and wrap the extract_features as a service. please refer to it: https://github.com/hanxiao/bert-as-service the avg. speed for 12 layer BERT with
max_seq_lenis about 2000 sample/s
@mfxss I solved this problem in this repo, and wrap the extract_features as a service. please refer to it: https://github.com/hanxiao/bert-as-service the avg. speed for 12 layer BERT with
max_seq_lenis about 2000 sample/s
Could you point out the behind idea and the code ? Thank you very much.
@ntson2002 checkout https://hanxiao.github.io/2019/01/02/Serving-Google-BERT-in-Production-using-Tensorflow-and-ZeroMQ/
Mark