Hi,
I am trying to convert the TF based squeezeDet (https://github.com/BichenWuUCB/squeezeDet) into DLC format.
Was able to freeze the graph into .pb format. As I am not sure if SNPE supports the extra interpretation layers in SqueezeDet, I have frozen the graph only till the conv12 layer.
While freezing I'm giving following as output nodes:
conv12/kernels,conv12/kernels/read,conv12/biases,conv12/biases/read,conv12/convolution,conv12/bias_add
The frozen .pb file is at this link: https://drive.google.com/open?id=1B2w4swFgx0yFgcYvN488V7amghN8fwSL
The output of running TF's summarize_graph tool on the same .pb file is at : https://drive.google.com/open?id=1Q4KZ97ER4XiAMGIxCEjdvNpZHRfCxfvq
The list of nodes inside .pb file are saved in a txt file: https://drive.google.com/open?id=1BZpYxa3T1xGR8kfRGxBD4MIOyf4DeTpu
Now when I try to convert the above .pb file to DLC using
snpe-tensorflow-to-dlc --graph dlc/0till_conv12/frozen_graph.pb -i input_ph_node 520,924,3 --out_node conv12/kernels --out_node conv12/kernels/read --out_node conv12/biases --out_node conv12/biases/read --out_node conv12/convolution --out_node conv12/bias_add --dlc sqDet.dlc
I get following error:
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (conv12/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (conv12/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire9/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (parallel_stack/ExpandDims) not consumed by converter: ExpandDims.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (parallel_stack/ParallelConcat) not consumed by converter: ParallelConcat.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire10/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (conv1/Relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (conv1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (pool1/MaxPool) not consumed by converter: MaxPool.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire11/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire2/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (pool5/MaxPool) not consumed by converter: MaxPool.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire3/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire6/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (pool3/MaxPool) not consumed by converter: MaxPool.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/expand3x3/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire7/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/expand1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/expand1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/expand1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire4/concat) not consumed by converter: ConcatV2.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/squeeze1x1/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/squeeze1x1/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/squeeze1x1/relu) not consumed by converter: Relu.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/expand3x3/convolution) not consumed by converter: Conv2D.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire5/expand3x3/bias_add) not consumed by converter: BiasAdd.
WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Operation (fire8/expand3x3/relu) not consumed by converter: Relu.
ERROR - Conversion failed: ERROR_TF_OPERATION_NOT_MAPPED_TO_LAYER: Some operations in the Tensorflow graph were not resolved to a layer. You can use --allow_unconsumed_node
Type your code in the box. To create a new line within the box use SHIFT + ENTER.
Looks like the error is related to SNPE not being able to detect the conv2D,Relu etc layers and map them to its own suppoted layers.
If the try snpe-tensorflow-to-dlc with --allow_unconsumed_node then only the input layer is getting coverted to DLC leaving out all the other layers. The DLC with just input layer is at: https://drive.google.com/open?id=12dgEKUdo6OsTOpNeaM0NX1NpQs5660QI
If I run snpe-dlc-info on the above DLC file, one can clearly see that only the input layer is getting frozen.
DLC info for /home/snpe-sdk/models/visteon_od/sqDet.dlc Model Version: N/A ------------------------------------------------------------------------------------------------------------------ | Id | Name | Type | Inputs | Outputs | Out Dims | Parameters | ------------------------------------------------------------------------------------------------------------------ | 0 | input_ph_node:0 | data | input_ph_node:0 | input_ph_node:0 | 520x924x3 | input_preprocessing: passthrough | | | | | | | | input_type: default | Total parameters 0 (0 MB assuming single precision float) Total MACs per inference: 0 (0%) Converter command: snpe-tensorflow-to-dlc verbose=False out_node=['conv12/kernels', 'conv12/kernels/read', 'conv12/biases', 'conv12/biases/read', 'conv12/convolution', 'conv12/bias_add'] allow_unconsumed_nodes=True model_version=None input_dim=[['input_ph_node', '520,924,3']] in_type=None DLC created with converter version: 1.15.0.0
Any help in finding out where I am going wrong. How do I make sure that SNPE detects the SqueezeDet layers.
Thanks.
*/
Hi Pratesh did you solved the problem of not converting the layers ?
Did you ever figure this out? I'm getting the exact error stream from a very simple network I created with Keras/Tensorflow that is simply:
Layer (type) Output Shape Param #
=================================================================
conv2d_1 (Conv2D) (None, 122, 9, 128) 1024
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 17, 9, 128) 0
_________________________________________________________________
conv2d_2 (Conv2D) (None, 13, 9, 128) 82048
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 2, 9, 128) 0
_________________________________________________________________
flatten_1 (Flatten) (None, 2304) 0
_________________________________________________________________
dropout_1 (Dropout) (None, 2304) 0
_________________________________________________________________
dense_1 (Dense) (None, 512) 1180160
_________________________________________________________________
dense_2 (Dense) (None, 6) 3078
=================================================================
Super simple. Trains perfectly, but same behavior as you described when trying to convert to dlc.
Please post any progress that you may have made, since Qualcomm support seems to have ignored your post.
Is it possible that networks other than sqeezenet will work the same way like you said the conversion to caffe model first and then .dlc ? Is this valid for all the model ? Please reply
Yes, It is possible to convert one model to other framework based model. There are lots of tools available online for model conversion. MMDNN is one of the model conversion tool with which you can try out first.
Can someone post the squeezedet.dlc files here