<reponame>linzijie1998/IMDN_Pytorch<filename>measure.py
from torchstat import stat
from model import imdn


if __name__ == '__main__':
    model_ca = imdn.IMDN()
    model_nl = imdn.IMDN_NLNN(nb=1)
    img_size = (3, 510, 339)
    # stat(model_ca, img_size)
    stat(model_nl, img_size)

# Total params: 898,576
# Total memory: 61.51MB
# Total MAdd: 7.3GMAdd
# Total Flops: 3.67GFlops
# Total MemR+W: 124.23MB

# Total params: 961,776
# Total memory: 89.50MB
# Total MAdd: 7.85GMAdd
# Total Flops: 3.95GFlops
# Total MemR+W: 188.47MB

from torchstat import stat
from model import imdn


if __name__ == '__main__':
    model_ca = imdn.IMDN()
    model_nl = imdn.IMDN_NLNN(nb=1)
    img_size = (3, 510, 339)
    # stat(model_ca, img_size)
    stat(model_nl, img_size)

# Total params: 898,576
# Total memory: 61.51MB
# Total MAdd: 7.3GMAdd
# Total Flops: 3.67GFlops
# Total MemR+W: 124.23MB

# Total params: 961,776
# Total memory: 89.50MB
# Total MAdd: 7.85GMAdd
# Total Flops: 3.95GFlops
# Total MemR+W: 188.47MB
# stat(model_ca, img_size) # Total params: 898,576 # Total memory: 61.51MB # Total MAdd: 7.3GMAdd # Total Flops: 3.67GFlops # Total MemR+W: 124.23MB # Total params: 961,776 # Total memory: 89.50MB # Total MAdd: 7.85GMAdd # Total Flops: 3.95GFlops # Total MemR+W: 188.47MB