在C ++中使用* .pth模型

时间:2020-10-21 09:16:35

标签: pytorch yolo torchscript

我想使用由pytorch训练的yolo3模型在C ++中运行推理。我无法使用pytorch提供的跟踪和脚本进行转换。转换过程中出现此错误

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 个答案:

没有答案