This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM-Q1: TIDL: How to import my Tensorflow model in TIDL?

Part Number: TDA4VM-Q1

Hi, Expert , 

I follow the TIDL guide to import the mobilenetV2 model (Model download from TIDL Link). It works well.

When I using the Tensorflow API to create a mobilenetv2 model.  Same method , I encountered below questions.  Main Code as below: 

model = MobileNetV2(weights='imagenet')

model.save("./saved_model_fredy")

! ls ./saved_model_fredy

assets	keras_metadata.pb  saved_model.pb  variables

Then I use the saved_demel.pb to run the below command. Thanks.

~/.local/lib/python3.6/site-packages/tensorflow/python/tools/ && python3 optimize_for_inference.py \
--input=/home/fredy/startJacinto/sdks/ti-processor-sdk-rtos-j721e-evm-08_01_00_11/`ls /home/fredy/startJacinto/sdks/ti-processor-sdk-rtos-j721e-evm-08_01_00_11 | grep tidl_`/ti_dl/test/testvecs/models/public/tensorflow/tf_fredy/tf_fredy.pb \
--output=/home/fredy/startJacinto/sdks/ti-processor-sdk-rtos-j721e-evm-08_01_00_11/`ls /home/fredy/startJacinto/sdks/ti-processor-sdk-rtos-j721e-evm-08_01_00_11 | grep tidl_`/ti_dl/test/testvecs/models/public/tensorflow/tf_fredy/tf_fredy_final.pb \
--input_names="input" \
--output_names="MobilenetV2/Predictions/Softmax"
Traceback (most recent call last):
File "optimize_for_inference.py", line 165, in <module>
app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/home/fredy/.local/lib/python3.6/site-packages/absl/app.py", line 303, in run
_run_main(main, args)
File "/home/fredy/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "optimize_for_inference.py", line 83, in main
input_graph_def.ParseFromString(data)
google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef'
 

Please help to check and give your comments. Thanks. 

Regards, 

Fredy Zhang