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
zhudaoruyi opened this issue Jun 23, 2019 · 2 comments
Open

如何计算模型所需的显存? #2

zhudaoruyi opened this issue Jun 23, 2019 · 2 comments

Comments

@zhudaoruyi
Copy link

zhudaoruyi commented Jun 23, 2019

培哥,这方面有没有经验呀?
input shape 固定的(比如(224,224,3))情况
input shape 不固定的(比如(None, None, 3))情况

@ypwhs
Copy link
Owner

ypwhs commented Jun 23, 2019

PyTorch 的话可以用这个库计算:https://github.com/Stonesjtu/pytorch_memlab

但是如果尺寸不固定,那么显存用量是算不出来的,你可以根据固定尺寸的显存占用量进行比例换算。比如输入图像如果是 (256, 256, 3),那么显存占用量大约是 (224, 224, 3) 的 1.3倍。

@zhudaoruyi
Copy link
Author

可以把这个放在 《指南》里不,包括tensorflow 的显存占用计算

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