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
Hello, I tried to custom train detectron2 on my dataset using faster_rcnn_X_101_32x8d_FPN_3x.yaml model as backbone for object detection.
I am curious of finding the exact number of trainable parameters I trained using the pre-trained model mentioned above.
I tried to print them using the below code block for total/trainable parameters but I believe that actually I trained much less parameters and the numbers I get are referring to the whole model's parameters:
from torch.nn.utils import parameters_to_vector
print(parameters_to_vector(predictor.model.parameters()).numel())
pytorch_total_params = sum(p.numel() for p in predictor.model.parameters() if p.requires_grad)
print(pytorch_total_params)
104384730
103959578
Can you please help me on this -to determine the exact number of parameters I trained? Thank you.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I tried to custom train detectron2 on my dataset using faster_rcnn_X_101_32x8d_FPN_3x.yaml model as backbone for object detection.
I am curious of finding the exact number of trainable parameters I trained using the pre-trained model mentioned above.
I tried to print them using the below code block for total/trainable parameters but I believe that actually I trained much less parameters and the numbers I get are referring to the whole model's parameters:
from torch.nn.utils import parameters_to_vector
print(parameters_to_vector(predictor.model.parameters()).numel())
pytorch_total_params = sum(p.numel() for p in predictor.model.parameters() if p.requires_grad)
print(pytorch_total_params)
104384730
103959578
Can you please help me on this -to determine the exact number of parameters I trained? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions