MicrocontrollersAndMore / TensorFlow_Tut_3_Object_Detection_Walk-through

TensorFlow Tutorial 3: Object Detection Walk-through
21 stars 20 forks source link

4_export_inference_graph.py #2

Closed tigon7476 closed 6 years ago

tigon7476 commented 6 years ago

Thank you very much for your great lecture!!

First I finished training about 500.
I wanted to do more iteration for training, so chaged num_steps item, 500 -> 10000 in ssd_inception_v2_coco.config file. After iteration, there were files like next in the training_data folder. model.ckpt-10000.data-00000-of-00001, model.ckpt-10000.index, model.ckpt-10000.meta

I ran 4_export_inference_graph.py, met AssertionError :

C:\Python\Python36\python.exe C:/Users/Admin/Documents/cris_dahms/TensorFlow_Tut_3_Object_Detection_Walk-through/4_export_inference_graph.py starting script . . . calling TrainEvalPipelineConfig() . . . checking and merging ssd_inception_v2_coco.config into trainEvalPipelineConfig . . . calculating input shape . . . calling export_inference_graph() . . . WARNING:tensorflow:From C:\TensorFlow\models\research\object_detection\exporter.py:351: get_or_create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version. Instructions for updating: Please switch to tf.train.get_or_create_global_step 2018-04-24 09:04:39.881702: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2018-04-24 09:04:40.163718: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1212] Found device 0 with properties: name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.645 pciBusID: 0000:01:00.0 totalMemory: 11.00GiB freeMemory: 10.55GiB 2018-04-24 09:04:40.163718: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1312] Adding visible gpu devices: 0 2018-04-24 09:04:40.719750: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10224 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1) 2018-04-24 09:04:44.292954: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1312] Adding visible gpu devices: 0 2018-04-24 09:04:44.292954: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 311 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1) Converted 410 variables to const ops. 2018-04-24 09:04:45.296011: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1312] Adding visible gpu devices: 0 2018-04-24 09:04:45.296011: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 311 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1) Traceback (most recent call last): File "C:/Users/Admin/Documents/cris_dahms/TensorFlow_Tut_3_Object_Detection_Walk-through/4_export_inference_graph.py", line 108, in tf.app.run() File "C:\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run _sys.exit(main(argv)) File "C:/Users/Admin/Documents/cris_dahms/TensorFlow_Tut_3_Object_Detection_Walk-through/4_export_inference_graph.py", line 56, in main exporter.export_inference_graph(INPUT_TYPE, trainEvalPipelineConfig, TRAINED_CHECKPOINT_PREFIX_LOC, OUTPUT_DIR, input_shape) File "C:\TensorFlow\models\research\object_detection\exporter.py", line 453, in export_inference_graph graph_hook_fn=None) File "C:\TensorFlow\models\research\object_detection\exporter.py", line 421, in _export_inference_graph placeholder_tensor, outputs) File "C:\TensorFlow\models\research\object_detection\exporter.py", line 280, in write_saved_model builder = tf.saved_model.builder.SavedModelBuilder(saved_model_path) File "C:\Python\Python36\lib\site-packages\tensorflow\python\saved_model\builder_impl.py", line 88, in init "directory: %s" % export_dir) AssertionError: Export directory already exists. Please specify a different export directory: C:\Users\Admin\Documents\cris_dahms\TensorFlow_Tut_3_Object_Detection_Walk-through/inference_graph\saved_model

I need your help, please

====================================================== I missed "Please specify a different export directory", inference_graph\saved_model delete saved_model folder, create new folder, change folder name "new folder" to "saved_model". After changing folder name, I met "done !!"