tensorflow / tensorflow/models
How to convert mobilenet v2 to pb?
Open
@pkulzc is already working on this.
Since Jun 19, 2020.
models:research:odapi
type:support
- 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: 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 18.04 (NVidia Docker: nvcr.io/nvidia/tensorrt:19.11)
- TensorFlow installed from (source or binary): binary (pip3 install tensorflow==1.12)
- TensorFlow version: v1.12.0-0-ga6d8ffae09 1.12.0
- Bazel version: N/A
- CUDA/cuDNN version:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243 - GPU model and memory: Quadro P5000
- Exact command to reproduce: see below.
Describe the problem
I am trying to convert sd_mobile net_v2_coco and convert then to uff - > CudaEngine. The original frozen_inference_graph.pb converts perfectly, but frozen_inference_graph after work object_detection/export_inference_graph.py no. If you compare the two models by hash sums-they are different. How to properly convert checkpoint (and ckpt) to get the original frozen_inference_graph.pb?
I run the conversion like this:
export PYTHONPATH=$(realpath ../tensorflow-models/research):$(realpath ../tensorflow-models/research/slim)
INPUT_TYPE=image_tensor
PIPELINE_CONFIG_PATH=$(realpath ssd_mobilenet_v2_13/pipeline.config)
TRAINED_CKPT_PREFIX=$(realpath ssd_mobilenet_v2_13/model.ckpt)
EXPORT_DIR=$(realpath ssd_mobilenet_v2_13/export/)
python3 -m object_detection.export_inference_graph \
--input_type=image_tensor \
--pipeline_config_path=${PIPELINE_CONFIG_PATH} \
--trained_checkpoint_prefix=${TRAINED_CKPT_PREFIX} \
--output_directory=${EXPORT_DIR}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.