Use *.pth model in C++

897 views Asked by At

I want to run inference in C++ using a yolo3 model I trained with pytorch. I am unable to make the conversions using tracing and scripting provided by pytorch. I have this error during conversion

First diverging operator:
    Node diff:
        - %2 : __torch__.torch.nn.modules.container.ModuleList = prim::GetAttr[name="module_list"](%self.1)
        + %2 : __torch__.torch.nn.modules.container.___torch_mangle_139.ModuleList = prim::GetAttr[name="module_list"](%self.1)
        ?                                           ++++++++++++++++++++
ERROR: Tensor-valued Constant nodes differed in value across invocations. This often indicates that the tracer has encountered untraceable code.
    Node:
        %358 : Tensor = prim::Constant[value=<Tensor>](), scope: __module.module_list.16.yolo_16
0

There are 0 answers