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 routine problems

Part Number: CODECOMPOSER

Tool/software:

Hello, I am using the sample code given by our company for quantitative perception training (QAT), and I have a problem in the code:

I have seen the quantitative tools provided by your company: It is mentioned in Github Readme:

Optional: We have provided a utility function called torchvision.edgeailite.xnn.utils.load_weights() that prints which parameters are loaded correctly and which are not - you can use this load function if needed to ensure that your parameters are loaded correctly.

. I want to use  torchvision.edgealite.xnn.utils.load_weights() tooling code for quantitative perception model checking after the training, but, I see the sample code given the following code:

# 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)

With the above code, I can't directly execute the xnn.utils.load_weights() function in else.

Do I need to modify other codes or parameters? Or delete if, else, and execute the xnn.utils.load_weights() function directly?

Looking forward to your reply!