tensorflow / tensorflow/models

Failed to reproduce frozen inference graph as in models zoo

Open
#5,640 9 comments 1 reaction 3 assignees View on GitHub

@pkulzc is already working on this.

Since Jul 10, 2020.

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

Description

System information
  • What is the top-level directory of the model you are using: tensorflow/models/tree/master/research/object_detection
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): NO
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • TensorFlow installed from (source or binary): source
  • TensorFlow version (use command below): 1.11.0
  • Bazel version (if compiling from source): 0.17.2
  • CUDA/cuDNN version: 9.2/7.1
  • GPU model and memory: GeForce GTX 1050 Ti, 4GB
  • Exact command to reproduce: Please check it in the problem description
Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.

These are the exact steps I am following:

  • Training ssd_inception_v2 model with the following command:
PIPELINE_CONFIG_PATH={path to pipeline config file}
MODEL_DIR={path to model directory}
NUM_TRAIN_STEPS=50000
SAMPLE_1_OF_N_EVAL_EXAMPLES=1
python object_detection/model_main.py \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --model_dir=${MODEL_DIR} \
    --num_train_steps=${NUM_TRAIN_STEPS} \
    --sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES \
    --alsologtostderr
  • Exporting the trained model for inference with the following command:
INPUT_TYPE=image_tensor
PIPELINE_CONFIG_PATH={path to pipeline config file}
TRAINED_CKPT_PREFIX={path to model.ckpt}
EXPORT_DIR={path to folder that will be used for export}
python object_detection/export_inference_graph.py \
    --input_type=${INPUT_TYPE} \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --trained_checkpoint_prefix=${TRAINED_CKPT_PREFIX} \
    --output_directory=${EXPORT_DIR}

The above command generates the frozen graph format of the exported model. The issue is - The custom_ssd_inception.tar.gz is way different from what is given in the ssd_inception_v2_coco_2018_01_28.tar.gz file in model zoo of object detection when visualized using tensorboard.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

Link to the config file: ssd_inception_v2_coco.config

When continued to convert the frozen graph to UFF using convert_to_uff.py, the output log files are as follows:
For the original model, given in model zoo: original-output.log
For custom model: custom-output.log

Can someone help me identify the exact issue? Where am I going wrong?

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.