vps做电影网站,百度免费建个人网站,常平网站,ui培训班 千锋教育概念
FLOPS#xff1a;注意全大写#xff0c;是floating point operations per second的缩写#xff0c;意指每秒浮点运算次数#xff0c;理解为计算速度。是一个衡量硬件性能的指标。
FLOPs#xff1a;注意s小写#xff0c;是floating point operations的缩写#xf…概念
FLOPS注意全大写是floating point operations per second的缩写意指每秒浮点运算次数理解为计算速度。是一个衡量硬件性能的指标。
FLOPs注意s小写是floating point operations的缩写s表复数意指浮点运算数理解为计算量。可以用来衡量算法/模型的复杂度。
单位换算
1 MFLOPs(mega) 10^6 FLOPs即100万次浮点运算
1 GFLOPs(giga) 10^9 FLOPs即10亿次浮点运算
1 TFLOPs(tera) 10^12 FLOPs即1万亿次浮点运算
参考链接 https://zhuanlan.zhihu.com/p/541165764
代码
import torch
from Net.MyNet import MyNet as net
from thop import profile
from thop import clever_formatmodel net()
input torch.rand(1,3,352,352)
input input.cuda()
flops, params profile(model, inputs(input,))
flops, params clever_format([flops, params], %.3f)print(模型参数params)
print(每一个样本浮点运算量,flops)