This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CODECOMPOSER:TexasInstruments/edgeai-modelzoo 例程问题

Guru**** 1826070 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1394475/codecomposer-texasinstruments-edgeai-modelzoo-routine-problems

器件型号:CODECOMPOSER

工具与软件:

您好,我正在使用我们公司提供的示例代码进行定量感知培训(QAT ),我的代码有问题:

我已经看到贵公司提供的定量工具:它在 Github 自述文件中提到:

可选:我们提供了一个名为 torchvision.edgeailite.xnn.utils.load_weights()的实用程序函数,该函数输出正确加载和不加载的参数-如果需要,您可以使用此加载函数来确保正确加载参数。

. 我想使用  torchvision.edgealite.xnn.utils.load_weights()工具代码在训练后进行定量感知模型检查、但我看到给定以下代码的示例代码:

# load pretrained model
if pretrained_data is not None and not is_onnx_model:
    model_orig = get_model_orig(model)
    for (p_data,p_file) in zip(pretrained_data, pretrained_files):
        print("=> using pretrained weights from: {}".format(p_file))
        if hasattr(model_orig, 'load_weights'):
            model_orig.load_weights(pretrained=p_data, change_names_dict=change_names_dict)
        else:
            xnn.utils.load_weights(get_model_orig(model), pretrained=p_data, change_names_dict=change_names_dict)

使用上述代码,我无法直接执行 else 中的 xnn.utils.load_weights()函数。

我是否需要修改其他代码或参数? 或者删除,否则,并直接执行 xnn.utils.load_weights()函数?

期待您的回复!