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.

TDA4VM: Import Custom AI Model fail.

Part Number: TDA4VM

There are few error when I imported the custom ONNX model with one input and two output.

Situation 1:

If I didn't set outDataNamesList, the error was as below.

keepdim for Argmax Layer shall be 1
axis for Argmax Layer shall be 1
[libprotobuf FATAL /home/a0393754/work/PSDKRA_07_02_00_02/ti-processor-sdk-rtos-j721e-evm-07_02_00_02/protobuf-3.5.1/src/google/protobuf/repeated_field.h:1522] CHECK failed: (index) < (current_size_):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: (index) < (current_size_):
Aborted (core dumped)

Situation 2:

Can not find input tensor if I didn't set inDataNamesList.

Error : Input for Layer : Not found in the input network

The network was outputted but with no layers detected.

Situation 3:

If I set inDataNamesList in config file, there was an error.

Error : Input for Layer input_tensor:input_tensor Not found in the input network

The network was outputted but with only two layers detected.

  • Hi,

    Sorry for the late reply.

    Can you please share the model you are running along with the config files with inDataNames and outDataNames set so I can check and reproduce the issue at my end?

    Regards,

    Anand

  • Hi,

    I modified the TIDL_onnxMapUpsampleParams function in tidl_onnxImport.cpp and fixed the error.

    I thought it might be some bug in it. The resize ratio is strange.

    I could not make sure that I did it right because I have another unsupported layer there.

    Maybe you can confirm that whether there is an error or not.

  • Hi,

    You need to give resize ratio as part of model instead of output size. Output size as input for above operator is not supported.

    If you have been able to fix it, that's alright; else you can also try below if needed.

    You can export the pytorch code with something like below example to convert output shape to ratio:

    /// sample current implementation

    out = F.interpolate(x, size=[output_h, output_w], mode='bilinear', align_corners=False)  

    ///Modified implementation

    h, w = x.shape[2:]

    h1 = output_h

    w1 = output_w

    s1, s2 = float(h1)/h, float(w1)/w

    out = F.interpolate(x, scale_factor=(s1,s2), mode='bilinear', align_corners=False)

    Regards,

    Anand