tensorflow / tensorflow/models

Execute inference throwing error: Google.Protobuf.Message.DecodeError: Error Parsing Message

Open
#6,622 8 comments 0 reactions 3 assignees View on GitHub

@pkulzc is already working on this.

Since Jul 1, 2020.

models:research:odapi type:support
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Hello all,

What is the top-level directory of the model you are using /tensorflow/models/research/object_detection
Have I written custom code: No
OS Platform and Distribution: Linux 16.04 LTS
TensorFlow installed from Bazel
TensorFlow version 1.12.0-rc2
Bazel version N/A
CUDA/cuDNN version CUDA release 10.0, V10.0.130, cudNN 7.3.1
GPU model and memory GeForce GTX 980 Ti, 6Gb
Exact command to reproduce: Exact command see above

I am currently using the Tensorflow Object Detection API to train a new model and test it with the KITTI data (as they are provided in within the API).

What have I done?
First, I downloaded the pre-trained ResNet101 model (trained on Kitti data) from the model zoo and I ran the inference and everything worked as expected.

However, running the inference on a fine-tuned model, I obtain the following error:

  File "infer_detections.py", line 96, in <module>
    tf.app.run()
  File "/home/user/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "infer_detections.py", line 74, in main
    image_tensor, FLAGS.inference_graph)
  File "/home/user/tensorflow/models/research/object_detection/inference/detection_inference.py", line 71, in build_inference_graph
    graph_def.MergeFromString(graph_content)
google.protobuf.message.DecodeError: Error parsing message

I use this command to do the inference:

python3.5 infer_detections.py --input_tfrecord_paths=/home/user/tensorflow/models/research/object_detection/data/kitti.record_val.tfrecord --output_tfrecord_path=/home/user/tensorflow/models/research/object_detection/OUTPUT/test/kitti_test.tfrecord --inference_graph=/home/user/tensorflow/models/research/object_detection/OUTPUT/model_12April/export/Servo/1555067137/saved_model.pb --discard_image_pixels

Does anybody know why this error appear? Could it be the case that the error is located within the structure of how the model is saved?
The downloaded pre-trained Resnet101 (trained on Kitti data) is organized in the following data structure

|-- faster_rcnn_resnet101_kitti_2018_01_28
    |-- saved_model
        |-- variables 
        |-- saved_model.pb
    |-- checkpoint
    |-- frozen_inference_graph.pb
    |-- model.ckpt.data-00000-of-00001
    |-- model.ckpt.index
    |-- model.ckpt.meta
    |--pipeline.config

However, the data folder that is created in my Output Folder of the training is organized in as follows:

|-- OutputFolder
    |-- eval_0
        |-- Eventfile
    |-- export
        |-- Servo 
            |-- 1555067137
                 |-- variables
                      |-- variables.data-00000-of-00001
                      |-- variables.index
                 |-- saved_model.pb
    |-- checkpoint 
    |--event File
    |-- graph.pbtxt
    |-- model.ckpt-1961.data-00000-of-00001
    |-- model.ckpt-1961.index
    |-- model.ckpt-1961.meta

Am I using the wrong pb file ? I do not see a frozen_inference_graph.pb file (or similar). Does anybody have a hint how I could solve this?

Thanks a lot in advance and kind regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.