hulianyuyy / CorrNet

Continuous Sign Language Recognition with Correlation Network (CVPR 2023)
84 stars 14 forks source link

Parameters/FLOPs #41

Closed kido1412y2y closed 3 months ago

kido1412y2y commented 4 months ago

Hello author, I would like to know the parameters and Flops of the model. Therefore, I added code to output the parameter quantity in test_one_video.py. However, I'm unsure about how to output Flops. Do you have any suggestions?Looking forward to receiving your help.

test_one_video.py ....... def count_parameters(model): return sum(p.numel() for p in model.parameters() if p.requires_grad) ......

Define model and load state-dict

model = SLRModel( num_classes=1296, c2d_type='resnet18', conv_type=2, use_bn=1, gloss_dict=gloss_dict, loss_weights={'ConvCTC': 1.0, 'SeqCTC': 1.0, 'Dist': 25.0}, )

num_params = count_parameters(model) print("Model has {} parameters".format(num_params)) ......

hulianyuyy commented 4 months ago

I calculate the FLOPs manually. In fact, i don't have a way to compute the FLOPs automatically.

kido1412y2y commented 3 months ago

I calculate the FLOPs manually. In fact, i don't have a way to compute the FLOPs automatically.

Thank you for your answer, may I ask if my calculation parameters are correct?

hulianyuyy commented 3 months ago

Yes, the way you use to calculate the parameters is correct.

kido1412y2y commented 3 months ago

Yes, the way you use to calculate the parameters is correct.

Thank you!