Hi,
I noticed in the tutorials that you can convert a tensorflow Mobile SSD model into a DLC file. However, I am trying to convert a Mobile SSD network I trained in Tensorflow 1.7 into a DLC and I am having some issues. At a high level I retrained the model provided in the tutorial but the corresponding inference network fails to convert. Here are the details:
This is how i got the frozen_inference_graph.pb:
First, I trained the model on my own dataset (which has 5 classes) by finetuning the official ssd_mobilenet_v1_coco_2017_11_17 model, downloaded by:
wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2017_11_17.tar.gz
Then, I exported the trained model files into an inference model file frozen_inference_graph.pb by
python object_detection/export_inference_graph.py --input_type image_tensor --pipeline_config_path ~/scratch/ssd_mobilenet_v1/train6/pipeline.config --trained_checkpoint_prefix ~/scratch/ssd_mobilenet_v1/train6/model.ckpt-120000 --output_directory ~/scratch/ssd_mobilenet_v1/train6/exported
I am trying to convert the ssd-mobilenet tensorflow model into dlc file. This is the command I ran:
snpe-tensorflow-to-dlc --graph frozen_inference_graph.pb -i Preprocessor/sub 300,400,3 --out_node detection_classes --out_node detection_boxes --out_node detection_scores --dlc mobilenet_ssd.dlc --allow_unconsumed_nodes
Then I met the following warning and error messages:
/home/xu/scratch/anaconda2/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
2018-04-30 13:20:33.705260: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-04-30 13:20:34.963213: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2574] has already been set.
2018-04-30 13:20:34.963251: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2588] has already been set.
2018-04-30 13:20:34.963267: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2578] has already been set.
2018-04-30 13:20:34.963277: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2577] has already been set.
2018-04-30 13:20:34.963301: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2575] has already been set.
2018-04-30 13:20:34.963322: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2576] has already been set.
2018-04-30 13:20:34.971732: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2580] has already been set.
2018-04-30 13:20:34.971754: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2579] has already been set.
2018-04-30 13:20:34.994931: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1865] has already been set.
2018-04-30 13:20:34.995029: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2413] has already been set.
2018-04-30 13:20:34.995072: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2427] has already been set.
2018-04-30 13:20:34.995107: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2416] has already been set.
2018-04-30 13:20:34.995132: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2423] has already been set.
2018-04-30 13:20:34.995142: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2429] has already been set.
2018-04-30 13:20:34.995264: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2420] has already been set.
2018-04-30 13:20:34.995304: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2414] has already been set.
2018-04-30 13:20:34.995338: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2419] has already been set.
2018-04-30 13:20:34.995370: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2417] has already been set.
2018-04-30 13:20:34.995453: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2422] has already been set.
2018-04-30 13:20:34.995538: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[2425] has already been set.
2018-04-30 13:20:34.995645: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1869] has already been set.
2018-04-30 13:20:34.995663: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1866] has already been set.
2018-04-30 13:20:34.995733: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1868] has already been set.
2018-04-30 13:20:34.995772: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1867] has already been set.
2018-04-30 13:20:35.111442: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1871] has already been set.
2018-04-30 13:20:35.111560: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1873] has already been set.
2018-04-30 13:20:35.111565: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1870] has already been set.
2018-04-30 13:20:35.111623: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1875] has already been set.
2018-04-30 13:20:35.111661: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1872] has already been set.
2018-04-30 13:20:35.111707: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at function_ops.cc:83 : Internal: Retval[1874] has already been set.
2018-04-30 13:20:35,128 - 391 - WARNING - ERROR_TF_FALLBACK_TO_ONDEMAND_EVALUATION: Unable to resolve operation output shapes in single pass. Using on-demand evaluation!
2018-04-30 13:21:01,005 - 123 - ERROR - Conversion failed: ERROR_TF_CONCAT_INPUT: Concatenation layer requires at least two inputs.
The weird thing is the conversion of the official model itself goes well perfectly, like in
and I thought finetuning a existing model would not change the architeture of the model itself. Could anyone help me with this?
Thanks!