在C+中使用*.pth模型+; 我想用Py火炬训练的YOLO3模型在C++中进行推理。我无法使用pytorch提供的跟踪和脚本进行转换。我在转换过程中遇到此错误 First diverging operator: Node diff

在C+中使用*.pth模型+; 我想用Py火炬训练的YOLO3模型在C++中进行推理。我无法使用pytorch提供的跟踪和脚本进行转换。我在转换过程中遇到此错误 First diverging operator: Node diff,pytorch,yolo,torchscript,Pytorch,Yolo,Torchscript,在C+中使用*.pth模型+; 我想用Py火炬训练的YOLO3模型在C++中进行推理。我无法使用pytorch提供的跟踪和脚本进行转换。我在转换过程中遇到此错误 First diverging operator: Node diff: - %2 : __torch__.torch.nn.modules.container.ModuleList = prim::GetAttr[name="module_list"](%self.1)

在C+中使用*.pth模型+; <>我想用Py火炬训练的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
第一个发散操作符:
节点差异:
-%2:\uuuu torch\uuuu.torch.nn.modules.container.ModuleList=prim::GetAttr[name=“module\u list”](%self.1)
+%2:\uuuuu torch\uuuu.torch.nn.modules.container.\uuuuuuu torch\u mangle\u 139.ModuleList=prim::GetAttr[name=“module\u list”](%self.1)
?                                           ++++++++++++++++++++
错误:不同调用的张量值常量节点的值不同。这通常表示跟踪程序遇到了无法跟踪的代码。
节点:
%358:Tensor=prim::Constant[value=](),作用域:_module.module_list.16.yolo_16

您是如何追踪您的模型的?您检查过了吗?因此,我遵循的是基本的,现在我使用您共享的链接转换了我的模型。谢谢,但是通过这个转换,我仍然无法在C++中加载模型。我有以下错误:
what():[enforce fail at inline_container.cc:209]。找不到文件:archive/constants.pkl frame#0:c10::ThrowEnforceNotMet(char-const*,int,char-const*,std::string-const&,void-const*)+0x47
您知道原因是什么吗。我对此不太清楚。谢谢当这类问题出现时,我通常会在discussion.pytorch.org上发布,或者在pytorch问题上发布一个问题。我建议首先给官方论坛一个机会。你是如何追踪你的模型的?你检查过了吗?因此我遵循了基本的,现在我使用你共享的链接转换了我的模型。谢谢,但是通过这个转换,我仍然无法在C++中加载模型。我有以下错误:
what():[enforce fail at inline_container.cc:209]。找不到文件:archive/constants.pkl frame#0:c10::ThrowEnforceNotMet(char-const*,int,char-const*,std::string-const&,void-const*)+0x47
您知道原因是什么吗。我对此不太清楚。谢谢当这类问题出现时,我通常会在discussion.pytorch.org上发布,或者在pytorch问题上发布一个问题。我建议先给官方论坛一个机会。