[Python] How to fix "unsupported argument type (RTTI disabled)" error when counting parameters...

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

  1. Stack

    Stack Membro Participativo

    I'm working with a complex model that integrates three other models. One of these internally uses two sub-models, one of which is DINOv2 (a pretrained model I'm using as-is).

    I'm trying to count the number of parameters using the code suggested in this Stack Overflow answer.

    However, I get the following error:


    RuntimeError: Found an unsupported argument type (RTTI disabled, cannot show name) in the JIT tracer. File a bug report.
    ​

    What I've tried:

    I searched on GitHub issues and discuss.pytorch.org and found a few discussions about this error. It seems related to tracing or scripting certain types of models. However, most solutions involve modifying the model or its components, which I want to avoid—especially since I'm using a pretrained DINOv2 model and don't want to retrain or alter its internal code.

    Maybe I'm misunderstanding the problem, as I'm still a beginner. I'd appreciate any guidance on how to handle this error or work around it without modifying the pretrained model.

    Thanks in advance!

    Continue reading...

Compartilhe esta Página