python - Parsing error from training script while trying to train on pet dataset -
i posted on tensorflow github i'm copying here it's more appropriate.
i require precious kind of stuck on weird config file parsing error. trying run locally train.py script on pet dataset. have done told in tutorial prepare data , config files, here directory structure:
+pets_example +data -pet_label_map.pbtxt -pet_train.record -pet_val.record +models +ssd_inception_v2_coco_11_06_2017 -frozen_inference_graph.pb -graph.pbtxt -model.ckpt.data-00000-of-00001 -model.ckpt.index -model.ckpt.meta -pipeline.proto
and here content of pipeline configuration file:
syntax = "proto2"; package object_detection.protos; import "object_detection/protos/eval.proto"; import "object_detection/protos/input_reader.proto"; import "object_detection/protos/model.proto"; import "object_detection/protos/train.proto"; // convenience message configuring training , eval pipeline. allows // of pipeline parameters configured 1 file. message trainevalpipelineconfig { optional detectionmodel model = 1; optional trainconfig train_config = 2; optional inputreader train_input_reader = 3; optional evalconfig eval_config = 4; optional inputreader eval_input_reader = 5; } model { ssd { num_classes: 37 box_coder { faster_rcnn_box_coder { y_scale: 10.0 x_scale: 10.0 height_scale: 5.0 width_scale: 5.0 } } matcher { argmax_matcher { matched_threshold: 0.5 unmatched_threshold: 0.5 ignore_thresholds: false negatives_lower_than_unmatched: true force_match_for_each_row: true } } similarity_calculator { iou_similarity { } } anchor_generator { ssd_anchor_generator { num_layers: 6 min_scale: 0.2 max_scale: 0.95 aspect_ratios: 1.0 aspect_ratios: 2.0 aspect_ratios: 0.5 aspect_ratios: 3.0 aspect_ratios: 0.3333 reduce_boxes_in_lowest_layer: true } } image_resizer { fixed_shape_resizer { height: 300 width: 300 } } box_predictor { convolutional_box_predictor { min_depth: 0 max_depth: 0 num_layers_before_predictor: 0 use_dropout: false dropout_keep_probability: 0.8 kernel_size: 3 box_code_size: 4 apply_sigmoid_to_scores: false conv_hyperparams { activation: relu_6, regularizer { l2_regularizer { weight: 0.00004 } } initializer { truncated_normal_initializer { stddev: 0.03 mean: 0.0 } } } } } feature_extractor { type: 'ssd_inception_v2' min_depth: 16 depth_multiplier: 1.0 conv_hyperparams { activation: relu_6, regularizer { l2_regularizer { weight: 0.00004 } } initializer { truncated_normal_initializer { stddev: 0.03 mean: 0.0 } } batch_norm { train: true, scale: true, center: true, decay: 0.9997, epsilon: 0.001, } } } loss { classification_loss { weighted_sigmoid { anchorwise_output: true } } localization_loss { weighted_smooth_l1 { anchorwise_output: true } } hard_example_miner { num_hard_examples: 3000 iou_threshold: 0.99 loss_type: classification max_negatives_per_positive: 3 min_negatives_per_image: 0 } classification_weight: 1.0 localization_weight: 1.0 } normalize_loss_by_num_matches: true post_processing { batch_non_max_suppression { score_threshold: 1e-8 iou_threshold: 0.6 max_detections_per_class: 100 max_total_detections: 100 } score_converter: sigmoid } } } train_config: { batch_size: 24 optimizer { rms_prop_optimizer: { learning_rate: { exponential_decay_learning_rate { initial_learning_rate: 0.004 decay_steps: 800720 decay_factor: 0.95 } } momentum_optimizer_value: 0.9 decay: 0.9 epsilon: 1.0 } } fine_tune_checkpoint: "pets_example/models/ssd_inception_v2_coco_11_06_2017/model.ckpt" from_detection_checkpoint: true data_augmentation_options { random_horizontal_flip { } } data_augmentation_options { ssd_random_crop { } } } train_input_reader: { tf_record_input_reader { input_path: "pets_example/data/pet_train.record" } label_map_path: "pets_example/data/pet_label_map.pbtxt" } eval_config: { num_examples: 2000 } eval_input_reader: { tf_record_input_reader { input_path: "pets_example/data/pet_val.record" } label_map_path: "pets_example/data/pet_label_map.pbtxt" }
i'm working on linux ubuntu 16.04, , have pip install version of tensorflow 1.1.0 (without gpu support, i'm running on cpu).
so when try command: python3 object_detection/train.py --logtostderr --pipeline_config_path='pets_example/models/ssd_inception_v2_coco_11_06_2017/pipeline.proto' --train_dir='pets_example/models/train_events/'
i following errors:
traceback (most recent call last): file "object_detection/train.py", line 201, in <module> tf.app.run() file "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) file "object_detection/train.py", line 146, in main model_config, train_config, input_config = get_configs_from_pipeline_file() file "object_detection/train.py", line 106, in get_configs_from_pipeline_file text_format.merge(a, pipeline_config) file "/usr/local/lib/python3.5/dist-packages/google/protobuf/text_format.py", line 481, in merge descriptor_pool=descriptor_pool) file "/usr/local/lib/python3.5/dist-packages/google/protobuf/text_format.py", line 535, in mergelines return parser.mergelines(lines, message) file "/usr/local/lib/python3.5/dist-packages/google/protobuf/text_format.py", line 568, in mergelines self._parseormerge(lines, message) file "/usr/local/lib/python3.5/dist-packages/google/protobuf/text_format.py", line 583, in _parseormerge self._mergefield(tokenizer, message) file "/usr/local/lib/python3.5/dist-packages/google/protobuf/text_format.py", line 657, in _mergefield (message_descriptor.full_name, name)) google.protobuf.text_format.parseerror: 1:1 : message type "object_detection.protos.trainevalpipelineconfig" has no field named "syntax".
i traced errors through different files , ran out of skills when looking descriptors stuff ... if can provide help, awesome ! :) in advance !
you aren't supposed have top part of config file --- try removing of following , try again:
syntax = "proto2"; package object_detection.protos; import "object_detection/protos/eval.proto"; import "object_detection/protos/input_reader.proto"; import "object_detection/protos/model.proto"; import "object_detection/protos/train.proto"; // convenience message configuring training , eval pipeline. allows // of pipeline parameters configured 1 file. message trainevalpipelineconfig { optional detectionmodel model = 1; optional trainconfig train_config = 2; optional inputreader train_input_reader = 3; optional evalconfig eval_config = 4; optional inputreader eval_input_reader = 5; }
also pipeline_config_path
should not point @ 1 of .proto files (which define schema of protos) --- should rather point @ .config files have in samples/configs directory.
Comments
Post a Comment