Calculating RAM size of network

This post (Finding model size) might help you.
If you want to print the RAM occupancy for each module, here’s an example snippet

for m in model.modules():
    for param in m.parameters():
        print(param.nelement() * param.element_size())
1 Like