You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I find that the results of fvcore.nn.prameter_count function and tensorflow are different when calculate same model.
The difference comes from the BN layer. tensorflow calculate beta, gamma, moving_mean and variance(four params), but fvcore.nn.prameter_count only calculate beta, gamma.
r = defaultdict(int)
for name, prm in model.named_parameters():
size = prm.numel()
name = name.split(".")
for k in range(0, len(name) + 1):
prefix = ".".join(name[:k])
using model.named_parameters() only get beta, gamma no moving_mean and variance.
Are there any other considerations?
The text was updated successfully, but these errors were encountered:
In pytorch terminology, technically the moving mean and variance are "buffers" but not "parameters".
In general, it's hard to automatically decide for a module whether its "buffers" should be included in parameter count, since in many other modules they are not useful at all after training. Maybe an option can be added to control whether to include all buffers or no buffers in the count. Other suggestions are welcome.
Hi, I find that the results of fvcore.nn.prameter_count function and tensorflow are different when calculate same model.
The difference comes from the BN layer. tensorflow calculate beta, gamma, moving_mean and variance(four params), but fvcore.nn.prameter_count only calculate beta, gamma.
for example:
result:
only calculate beta, gamma.
In https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/parameter_count.py#L10-L30
using
model.named_parameters()
only get beta, gamma no moving_mean and variance.Are there any other considerations?
The text was updated successfully, but these errors were encountered: