Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

预测速度 #2

Open
semal opened this issue Aug 8, 2019 · 3 comments
Open

预测速度 #2

semal opened this issue Aug 8, 2019 · 3 comments

Comments

@semal
Copy link

semal commented Aug 8, 2019

我在“AI前线“的公众号上看到 BertNER 的预测速度可以达到 80ms,想问一下您是如何计算的,有用到一些模型的优化技术吗?我使用 Tensorflow serving 在 P100 下的预测速度都只能达到 400ms 左右。希望能得到您的指导~

@Biaocsu
Copy link

Biaocsu commented Aug 8, 2019

@semal 你好,我也是在“AI 前线”上看到然后想自己测试下效果,因为平常用的pytorch,对tensorflow也不是很熟悉,现在运行该代码遇到这样报错(AttributeError: module 'tensorflow.contrib.estimator' has no attribute 'stop_if_no_decrease_hook')你应该也遇到了,请问你是如何解决的?tensorflow=1.14.0-gpu

@EOA-AILab
Copy link
Owner

EOA-AILab commented Aug 22, 2019

我在“AI前线“的公众号上看到 BertNER 的预测速度可以达到 80ms,想问一下您是如何计算的,有用到一些模型的优化技术吗?我使用 Tensorflow serving 在 P100 下的预测速度都只能达到 400ms 左右。希望能得到您的指导~
@semal 您好!我们这次的实验依赖于Bert本身的模型技术,没有做出优化。我们也发现速度的差异发生在以下两个方面:1.基于不同的硬件环境(GPU和CPU),2.预测文本的长度。我们是在11G Nvidia RTX2080Ti、Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz的环境中进行实验,所以您如果保证预测文本长度一样的话,所出现的预测速度差异应该是硬件的使用差异。而我们也正在做bert模型速度优化的研究,之后也会发出来。

@EOA-AILab
Copy link
Owner

@semal 你好,我也是在“AI 前线”上看到然后想自己测试下效果,因为平常用的pytorch,对tensorflow也不是很熟悉,现在运行该代码遇到这样报错(AttributeError: module 'tensorflow.contrib.estimator' has no attribute 'stop_if_no_decrease_hook')你应该也遇到了,请问你是如何解决的?tensorflow=1.14.0-gpu

@Biaocsu 你好!你的这个问题是由于tensorflow的新版本所引起的。tensorflow-gpu 1.14.0版本通过import tensorflow.estimator.experimental.stop_if_no_decrease_hook进行调用。建议尝试换成tensorflow-gpu 1.13.1版本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants