Forums - snpe-tflite-to-dlc crashes with Reshape layer

4 posts / 0 new
Last post
snpe-tflite-to-dlc crashes with Reshape layer
jtorkelson
Join Date: 12 Oct 16
Posts: 6
Posted: Tue, 2023-09-19 11:07

I was troubleshooting an issue with snpe-tflite-to-dlc crashing, where it just prints "Segmentation Fault" without anything useful. I trained a simple network and attempted to convert it.

The model below trains and is successfully converted to DLC:

model = tf.keras.Sequential([
        tf.keras.layers.Input(shape=(13, 33, 1)),  # Input layer with shape (1, 15, 15, 1)
        #tf.keras.layers.Reshape((13,33,1)),
        tf.keras.layers.Conv2D(3, (3, 3), activation='relu', padding='same', name='STG1_LCNN2'),
        tf.keras.layers.Flatten(),  # Flatten the input to a 1D tensor
        tf.keras.layers.Dense(1, activation='sigmoid')  # Single dense layer with sigmoid activation
    ])
 

Note that this input layer has shape (13, 33, 1). I then changed the input shape to (1, 13, 33, 1), and added a Reshape() layer, trained it, and tried to convert it. When I converted it, it generates the Segmentation Fault crash.

model = tf.keras.Sequential([
        tf.keras.layers.Input(shape=(1, 13, 33, 1)),  # Input layer with shape (1, 15, 15, 1)
        tf.keras.layers.Reshape((13,33,1)),
        tf.keras.layers.Conv2D(3, (3, 3), input_shape = input_shape[1:], activation='relu', padding='same', name='STG1_LCNN2'),
        tf.keras.layers.Flatten(),  # Flatten the input to a 1D tensor
        tf.keras.layers.Dense(1, activation='sigmoid')  # Single dense layer with sigmoid activation
    ])


In the first case, I am telling snpe-tflite-to-dlc that the input shape is (1, 13, 33, 1), even though it is really (13, 33, 1), and it doesn't seem to cause a problem. But it crashes when I try to use a reshape layer, and that is a problem. The SNPE documentation says that the Reshape() layer is supported. Am I doing something wrong, or is there a bug?

 

Thanks

 

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Fri, 2023-09-22 19:38

Dear developer,

What's your SNPE version tried to convert? You could add debug level to converter to review what's error happened.

BR.

Wei

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Fri, 2023-09-22 19:39

Dear developer,

What's your SNPE version tried to convert? You could add debug level to converter to review what's error happened.

BR.

Wei

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Fri, 2023-09-22 19:54

Dear developer,

What's your SNPE version tried to convert? You could add debug level to converter to review what's error happened.

BR.

Wei

  • 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.