导出训练后的推理图TENSERFLOW

时间:2019-08-19 20:35:33

标签: tensorflow

我已经训练了自定义模型,并希望导出训练有素的推理图

我运行了以下命令

INPUT_TYPE=image_tensor
PIPELINE_CONFIG_PATH= training/ ssd_mobilenet_v1_pets.config
TRAINED_CKPT_PREFIX= training/model.ckpt-2509
EXPORT_DIR= training/new_model
python exporter.py \
    --input_type=${INPUT_TYPE} \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --trained_checkpoint_prefix=${TRAINED_CKPT_PREFIX} \
    --output_directory=${EXPORT_DIR}

我得到以下输出

W0819 22:08:54.649750  2680 deprecation_wrapper.py:119] From C:\Users\Aleksej\Anaconda3\envs\cocosynth4\lib\site-packages\object_detection-0.1-py3.6.egg\nets\mobilenet\mobilenet.py:397: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.


(cocosynth4) D:\yolo\models\research\object_detection>    --input_type=${INPUT_TYPE} \
'--input_type' is not recognized as an internal or external command,
operable program or batch file.

(cocosynth4) D:\yolo\models\research\object_detection>    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
'--pipeline_config_path' is not recognized as an internal or external command,
operable program or batch file.

(cocosynth4) D:\yolo\models\research\object_detection>    --trained_checkpoint_prefix=${TRAINED_CKPT_PREFIX} \
'--trained_checkpoint_prefix' is not recognized as an internal or external command,
operable program or batch file.

(cocosynth4) D:\yolo\models\research\object_detection>    --output_directory=${EXPORT_DIR}
'--output_directory' is not recognized as an internal or external command,
operable program or batch file.

我正在运行Windows 10和python3。 有人对如何解决此问题有任何建议

1 个答案:

答案 0 :(得分:0)

使用此代码固定

python export_inference_graph.py --input_type image_tensor --pipeline_config_path training / ssd_mobilenet_v1_pets.config --trained_checkpoint_prefix training / model.ckpt-3970 --output_directoryships_inference_graph