0
votes

So, after training on the cloud, I tried to export the inference graph using the following link:

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/exporting_models.md

The code that I used was:

python export_inference_graph.py \--input_type image_tensor \--pipeline_config_path samples/configs/ssd_mobilenet_v1_pets \--trained_checkpoint_prefix training\model.ckpt-29809 \--output_directory crop_graph1

It throws an error:

C:\Users\kannan\Desktop\Deep Learning Projects\GCP\models\research\object_detection>python export_inference_graph.py --input_type image_tensor --pipeline_config_path samples/configs/ssd_mobilenet_v1_pets --trained_checkpoint_prefix training\model.ckpt-29809 --output_directory crop_graph1 Traceback (most recent call last):
File "export_inference_graph.py", line 119, in tf.app.run() File "C:\Users\kannan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 41, in run flags_passthrough = f._parse_flags(args=args) File "C:\Users\kannan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\flags.py", line 45, in _parse_flags self._assert_all_required() File "C:\Users\kannan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\flags.py", line 78, in _assert_all_required self._assert_required(flag_name) File "C:\Users\kannan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\flags.py", line 74, in _assert_required raise AttributeError('Flag --%s must be specified.' % flag_name) AttributeError: Flag --output_directory must be specified.

Any idea how to get around this?

1

1 Answers

1
votes

I think the issue arises from below line

\--trained_checkpoint_prefix training\model.ckpt-29809 \--output_directory crop_graph1

this training\model.ckpt-29809 should have a double quote like

"training\model.ckpt-29809"

I assume python is treating that extra "-" between ckpt and 29809 Or maybe remove the backslash as it meant for continuous command.

The command should be in one line without "\"

python export_inference_graph.py --input_type image_tensor --pipeline_config_path samples/configs/ssd_mobilenet_v1_pets --trained_checkpoint_prefix "training\model.ckpt-29809" --output_directory crop_graph1