Forums - Convertion error due to missing bias

3 posts / 0 new
Last post
Convertion error due to missing bias
daniel.gonzalez
Join Date: 19 Jul 18
Posts: 4
Posted: Thu, 2018-08-02 04:46

Hi all,

I'm trying to convert a model with snpe-tensorflow-to-dlc but I'm getting the following error:

ERROR - Conversion failed: ERROR_TF_CONV_RESOLVE_BIAS: Cannot resolve convolution layer due to missing bias after operation: CNN/CNN_conv
 

Is there a way to convert a layer that does not have bias?

Thanks in advance

  • Up0
  • Down0
f10.liu
Join Date: 22 Mar 18
Posts: 15
Posted: Thu, 2018-08-02 20:11

Hi, I meet this problem before, here is my solution:

Modify get_biases () function in ~/snpe/lib/python/converters/tensorflow/layers/convolution.py :

    def get_biases(self, graph_helper, conv_op, bias_op):
        _, biases_tensor = GraphHelper.get_op_input_tensors(bias_op, ('?', '?'))
        if biases_tensor.op.type not in ['Identity', 'Const']:
            # raise ConverterError(code_to_message.get_message('ERROR_TF_CONV_RESOLVE_BIAS')(conv_op.name))
            biases = None
        else:
            biases = graph_helper.evaluate_tensor_output(biases_tensor)
        return biases
 
 
I hope this will help you.
  • Up0
  • Down0
daniel.gonzalez
Join Date: 19 Jul 18
Posts: 4
Posted: Fri, 2018-08-03 02:35

Hi,

I tried your solution and worked well for me.

Thank you so much :)

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.