[Python] fvcore multiple arguments forward modules?

Discussão em 'Python' iniciado por Stack, Agosto 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have a model that take more than one arguments in forward. Recently I'm trying to query some informations my model by fvcore module in python, but I can't find any document for multiple forward arguments!

    and edited code tried to have multiple functions:

    from fvcore.nn import FlopCountAnalysis, parameter_count_table

    def modelCount(model, input_tensor, *args, **kwargs):
    def _wrapped_forward(x):
    return model(x, *args, **kwargs)
    flops = FlopCountAnalysis(_wrapped_forward, input_tensor).total()
    params = parameter_count_table(model)
    return flops, params



    but it does not help ... I still have error.

    Continue reading...

Compartilhe esta Página