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

在训练的时候glops计算量不显示是怎么回事 #22

Closed
zhangshoulong opened this issue Apr 8, 2023 · 3 comments
Closed

在训练的时候glops计算量不显示是怎么回事 #22

zhangshoulong opened this issue Apr 8, 2023 · 3 comments

Comments

@zhangshoulong
Copy link

在训练的时候glops计算量不显示是怎么回事

@icey-zhang
Copy link
Owner

用test.py文件中的thop库可以测试参数量和GFLOPs。解开注释就可以。
# import thop
# input_image_size = opt.img_size
# input_image = torch.randn(1, 3, input_image_size, input_image_size).to(device)
# flops, params = thop.profile(model, inputs=(input_image,input_image,input_mode), verbose=False)
# print('Params: %.4fM'%(params/1e6))
# print('FLOPs: %.2fG'%(flops/1e9))

@zhangshoulong
Copy link
Author

感谢

@leileilei2000
Copy link

用 test.py 文件中的thop库可以测试参数量和GFLOPs。解开注释就可以。 # import thop # input_image_size = opt.img_size # input_image = torch.randn(1, 3, input_image_size, input_image_size).to(device) # flops, params = thop.profile(model, inputs=(input_image,input_image,input_mode), verbose=False) # print('Params: %.4fM'%(params/1e6)) # print('FLOPs: %.2fG'%(flops/1e9))

Snipaste_2024-01-13_09-47-20
为什么前后输出的参数不一样呢?

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