Hi there,
I am trying to convert the SSD MobileNet v2 model into the TIDL format.
I am using TensorFlow 1.12, as suggested by TI docs and TensorFlow Slim.
I downloaded the file supported by TIDL:
http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_coco_2018_03_29.tar.gz
At first I checked out the master version of TensorFlow Slim.
I run:
MODEL_NAME="ssd_mobilenet_v2"
ZIPPED_MODEL="ssd_mobilenet_v2_coco_2018_03_29.tar.gz"
URL_MODEL="download.tensorflow.org/.../ssd_mobilenet_v2_coco_2018_03_29.tar.gz"
IN_PB_FILE="frozen_inference_graph.pb"
OUT_PB_FILE="ssd_mobilenet_v2_final.pb"
TIDL_IO_FILE="tidl_ssd_mobilenet_v2_io_1.bin"
TIDL_NET_FILE="tidl_ssd_mobilenet_v2_net.bin"
INPUT_NAMES="image_tensor"
OUTPUT_NAMES="detection_boxes,detection_scores,detection_classes,num_detections"
CONVERSION_CONFIG_FILE="tidl_import_ssd_mobilenet_v2_slim.txt"
python ${TF_INSTALL_ROOT}/python/tools/optimize_for_inference.py \
--input=${IMPORTED_MODELS_DIRPATH}/${MODEL_NAME}/${IN_PB_FILE} \
--output=${IMPORTED_MODELS_DIRPATH}/${MODEL_NAME}/${OUT_PB_FILE} \
--input_names=${INPUT_NAMES} \
--output_name=${OUTPUT_NAMES}
The ssd_mobilenet_v2_final.pb is correctly created. Then, when I run the tidl_model_import I get:
Conversion into bin file...
TF Model (Proto) File : ../../test/testvecs/models/public/tensorflow/ssd_mobilenet_v2/ssd_mobilenet_v2_final.pb
TIDL Network File : ../../test/testvecs/config/tidl_models/tensorflow/tidl_ssd_mobilenet_v2_net.bin
TIDL IO Info File : ../../test/testvecs/config/tidl_models/tensorflow/tidl_ssd_mobilenet_v2_io_
TF operator Assert is not suported now.. By passing
TF operator Identity is not suported now.. By passing
TF operator Identity is not suported now.. By passing
TF operator Identity is not suported now.. By passing
TF operator Identity is not suported now.. By passing
TF operator Assert is not suported now.. By passing
TF operator Assert is not suported now.. By passing
TF operator All is not suported now.. By passing
TF operator Cast is not suported now.. By passing
TF operator TensorArrayGatherV3 is not suported now.. By passing
TF operator TensorArrayGatherV3 is not suported now.. By passing
TF operator Equal is not suported now.. By passing
TF operator Equal is not suported now.. By passing
TF operator Equal is not suported now.. By passing
TF operator TensorArrayGatherV3 is not suported now.. By passing
TF operator TensorArrayGatherV3 is not suported now.. By passing
TF operator Const is not suported now.. By passing
[libprotobuf FATAL /datalocal1/user/kumar/tidl_tools/protobuf-3.5.1/src/google/protobuf/repeated_field.h:1522] CHECK failed: (index) < (current_size_):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: (index) < (current_size_):
/home/dminguzzi/zf_wrkdir/repo_tda4/benchmark_tidl/zf_convert_all_models.sh: line 76: 13431 Aborted (core dumped) .
I tried to remove names from the OUTPUT_NAMES variable, the result is the same.
I read the note at "Some remarks on frozen inference graphs:" in the documentation, but I don't think they apply, since I am using TF 1.12.
A post on the forum suggests to checkout the version Slim commit d7ce21fa4d3b8b204530873ade75637e1313b760
If I do, I get a slightly different list of unsupported operators, but still a core dump.
Conversion into bin file...
TF Model (Proto) File : ../../test/testvecs/models/public/tensorflow/ssd_mobilenet_v2/ssd_mobilenet_v2_final.pb
TIDL Network File : ../../test/testvecs/config/tidl_models/tensorflow/tidl_ssd_mobilenet_v2_net.bin
TIDL IO Info File : ../../test/testvecs/config/tidl_models/tensorflow/tidl_ssd_mobilenet_v2_io_
TF operator Assert is not suported now.. By passing
TF operator Identity is not suported now.. By passing
TF operator Assert is not suported now.. By passing
TF operator Assert is not suported now.. By passing
TF operator All is not suported now.. By passing
TF operator Cast is not suported now.. By passing
TF operator Equal is not suported now.. By passing
TF operator Equal is not suported now.. By passing
TF operator Equal is not suported now.. By passing
TF operator TensorArrayGatherV3 is not suported now.. By passing
TF operator StridedSlice is not suported now.. By passing
TF operator StridedSlice is not suported now.. By passing
TF operator Const is not suported now.. By passing
[libprotobuf FATAL /datalocal1/user/kumar/tidl_tools/protobuf-3.5.1/src/google/protobuf/repeated_field.h:1522] CHECK failed: (index) < (current_size_):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: (index) < (current_size_):
/home/dminguzzi/zf_wrkdir/repo_tda4/benchmark_tidl/zf_convert_all_models.sh: line 77: 13300 Aborted (core dumped) ./out/tidl_model_import.out ${TIDL_INSTALL_PATH}/ti_dl/test/testvecs/config/import/public/tensorflow/${CONVERSION_CONFIG_FILE}
I pasted below my import configuration file.
modelType = 1
numParamBits = 8
# quantizationStyle = 2
inputNetFile = "../../test/testvecs/models/public/tensorflow/ssd_mobilenet_v2/ssd_mobilenet_v2_final.pb"
outputNetFile = "../../test/testvecs/config/tidl_models/tensorflow/tidl_ssd_mobilenet_v2_net.bin"
outputParamsFile = "../../test/testvecs/config/tidl_models/tensorflow/tidl_ssd_mobilenet_v2_io_"
inDataNorm = 1
inMean = 128 128 128
inScale = 0.0078125 0.0078125 0.0078125
inData = ../../test/testvecs/config/detection_list.txt
postProcType = 2
# resizeWidth = 300
# resizeHeight = 300
# inWidth = 300
# inHeight = 300
# inNumChannels = 3
Any suggestion is appreciated.
Best Regards,
Diego


