thop 是啥
能计算模型参数量和计算量
如何安装
安装最新的
pip install --upgrade git+https://github.com/Lyken17/pytorch-OpCounter.git
或者 安装默认的
pip install thop
使用见 github
thop github
问题
出现 no attribute ‘affine’
AttributeError: 'LayerNorm' object has no attribute 'affine'
回退到老版本可解决
pip install thop==0.0.31-2005241907