Conversion from 4D to 2D and back is unsupported: I run into issues where the first dimension seems to be reserved as the batch dimension only.
Here is simple TensorFlow code which is stand-alone and produces the issue. It classifies MNIST, data is automatically downloaded. The ProtoBuf graph is automatically created by the code. Here is the code:
The command I used to create the DLC is:
snpe-tensorflow-to-dlc --graph graph.pb --input_dim input 28,28,1 --out_node output --dlc graph.dlc
The message I get from the tool is:
~/snpe-1.4.0/lib/python/converters/tensorflow/layers/reshape.py:83: RuntimeWarning: error_code=1004; error_message=Layer parameters combination is invalid. Layer reshape/4d_to_2d: tensor size mismatch between input {28, 28, 1} and output {1}; error_component=Model Validation; line_no=130; thread_id=139684032206592 output_name)~/snpe-1.4.0/lib/python/converters/tensorflow/layers/reshape.py:83: RuntimeWarning: error_code=1004; error_message=Layer parameters combination is invalid. Layer reshape/2d_to_4d: tensor size mismatch between input {1} and output {28, 28, 1}; error_component=Model Validation; line_no=130; thread_id=139684032206592 output_name)
Hello CN,
SNPE does not currently support 4D input tensors (batched inputs). You may want to try the following with a single element in the batch dimension:
Not sure how to proceed here. I tried with batch size of one and with "--allow_unconsumed_nodes", but the warning message doesn't change. When running the network with the provided example Android application it still crashes at runtime with more or less the same message: