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

Closed
nutalk opened this issue Aug 22, 2019 · 4 comments
Closed

模型预测阶段内存占用 #2

nutalk opened this issue Aug 22, 2019 · 4 comments

Comments

@nutalk
Copy link

nutalk commented Aug 22, 2019

你好,在模型预测阶段,能不能减少内存占用?一般的服务器就算不训练,只预测也不够用啊。

@SeanLee97
Copy link
Owner

@nutalk 请问你的机器配置是什么呢?
减少内存占用可适当降低 batch_size 和减少模型参数量

@nutalk
Copy link
Author

nutalk commented Aug 23, 2019

@nutalk 请问你的机器配置是什么呢?
减少内存占用可适当降低 batch_size 和减少模型参数量

训练模型是32g内存的机器,部署成接口的机器只有4G内存。
我看模型在预测阶段载入了训练数据,是不是这个过程比较占内存?

@SeanLee97
Copy link
Owner

@nutalk infer 时可以把 config 里的 train_file 设为 None 应该就不会加载训练数据:https://github.com/SeanLee97/clfzoo/blob/master/clfzoo/dataloader.py#L39
但是词典肯定是要加载的,不过 4G 内存还是比较小

@nutalk
Copy link
Author

nutalk commented Aug 23, 2019

设置成None确实小了很多。谢谢。
ps:你的项目很好,节约了很多工程时间,非诚感谢。

@nutalk nutalk closed this as completed Aug 23, 2019
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

2 participants