'Parsing Inputs… Incomplete shape' error while exporting the inference graph in Tensorflow

无人久伴 提交于 2019-12-10 10:56:33

问题


I am training a neural network using Tensorflow's object detetction API to detect cars. I used the following sentdex's youtube video to learn and execute the process.

https://www.youtube.com/watch?v=srPndLNMMpk&t=65s

Also text version of his videos:

https://pythonprogramming.net/testing-custom-object-detector-tensorflow-object-detection-api-tutorial/?completed=/training-custom-objects-tensorflow-object-detection-api-tutorial/

Part 1 to 6 of his series.

My training data has ~300 images Test data ~ 20 images

Since I am using the concept of transfer learning, I chose ssd_mobilenet_v1.model.

Tensorflow version 1.10 (on CPU) Python version 3.6

I trained till ~ 8000 steps and an loss of ~1.

Everything runs smoothly till I try to export the inference graph.

I run the following command :

python3 export_inference_graph.py \
--input_type image_tensor \
--pipeline_config_path training/ssd_mobilenet_v1_pets.config \
--trained_checkpoint_prefix training/model.ckpt-7882 \
--output_directory car_inference_graph

After this command, I get

The warning:

WARNING:tensorflow:From 
/home/mydir/Desktop/models/research/object_detection/exporter.py:280: 
get_or_create_global_step (from 
tensorflow.contrib.framework.python.ops.variables) is deprecated and will be 
removed in a future version.
Instructions for updating:
Please switch to tf.train.get_or_create_global_step
WARNING:tensorflow:From 
/home/mydir/Desktop/models/research/object_detection/exporter.py:434: 
print_model_analysis (from tensorflow.contrib.tfprof.model_analyzer) is 
deprecated and will be removed after 2018-01-01.
Instructions for updating:
Use `tf.profiler.profile(graph, run_meta, op_log, cmd, options)`. Build 
`options` with `tf.profiler.ProfileOptionBuilder`. See README.md for details
106 ops no flops stats due to incomplete shapes.
Parsing Inputs...
Incomplete shape.

Then there is a list of model report after this. (I can post it if you want it)

I have the exported car_inference_graph folder though, which has checkpoint files,etc. inside it like it should have.

But when I run this model on images of car(test images or new images), it doesn't detect cars. i.e. there is no bounding box!

I am not sure if this warning has affected the detection and if it did, please help me solve it!

Thank you!

PS: to help identify the cause of 'no bounding box', it is worth mentioning that it doesn't even show the bounding boxes around the cars in images that the model has been trained with. This means there is something wrong with the export of inference graph or the bounding box function itself.

I just found out that '.pbtxt' file had name : macncheese instead of name : car. Did it happen to cause the problem?


回答1:


The label name used during labelling and the pbtxt entry should exactly match . In your case as the names are different, you would have to change name in the pbtxt file and re-run the training.




回答2:


Interesting to see if you fixed this - I followed the same tutorial and think I have the exact same problem.

Only I had the correct pbtxt files. I'm out of ideas on what has caused this, my next steps will be to try a different model and perhaps move out of the legacy folder.



来源:https://stackoverflow.com/questions/52002256/parsing-inputs-incomplete-shape-error-while-exporting-the-inference-graph-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!