EdjeElectronics / TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

How to train a TensorFlow Object Detection Classifier for multiple object detection on Windows
Apache License 2.0
2.92k stars 1.3k forks source link

ValueError: model_config not of type model_pb2.DetectionModel. #180

Open LyonOconner opened 5 years ago

LyonOconner commented 5 years ago

When I run train.py I get this error:

(tensorflow1) C:\TensorFlow\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config WARNING:tensorflow:From C:\ProgramData\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py:124: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. W1031 16:28:00.182125 12248 tf_logging.py:118] From C:\ProgramData\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py:124: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. Traceback (most recent call last): File "train.py", line 184, in tf.app.run() File "C:\ProgramData\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run _sys.exit(main(argv)) File "C:\ProgramData\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\util\deprecation.py", line 136, in new_func return func(*args, **kwargs) File "train.py", line 180, in main graph_hook_fn=graph_rewriter_fn) File "C:\TensorFlow\models\research\object_detection\legacy\trainer.py", line 248, in train detection_model = create_model_fn() File "C:\TensorFlow\models\research\object_detection\builders\model_builder.py", line 113, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel.

julianweisbord commented 5 years ago

I am experiencing the same issue

prasanna532 commented 5 years ago

Iam also facing the same issue

sneha-v commented 5 years ago

i have same issue. can someone please help.

sneha-v commented 5 years ago

please helpppppp

sneha-v commented 5 years ago

pleaseeeeee

prasanna532 commented 5 years ago

@sneha-v which model you are using for training

sneha-v commented 5 years ago

Faster rcnn.

prasanna532 commented 5 years ago

I also had same issue i have used this it started working........

model { faster_rcnn { num_classes: 6 image_resizer { keep_aspect_ratio_resizer { min_dimension: 600 max_dimension: 1024 } } feature_extractor { type: "faster_rcnn_inception_resnet_v2" first_stage_features_stride: 8 } first_stage_anchor_generator { grid_anchor_generator { scales: 0.25 scales: 0.5 scales: 1.0 scales: 2.0 aspect_ratios: 0.5 aspect_ratios: 1.0 aspect_ratios: 2.0 height_stride: 8 width_stride: 8 } } first_stage_atrous_rate: 2 first_stage_box_predictor_conv_hyperparams { op: CONV regularizer { l2_regularizer { weight: 0.0 } } initializer { truncated_normal_initializer { stddev: 0.01 } } } first_stage_nms_score_threshold: 0.0 first_stage_nms_iou_threshold: 0.7 first_stage_max_proposals: 300 first_stage_localization_loss_weight: 2.0 first_stage_objectness_loss_weight: 1.0 initial_crop_size: 17 maxpool_kernel_size: 1 maxpool_stride: 1 second_stage_box_predictor { mask_rcnn_box_predictor { use_dropout: false dropout_keep_probability: 1.0 fc_hyperparams { op: FC regularizer { l2_regularizer { weight: 0.0 } } initializer { variance_scaling_initializer { factor: 1.0 uniform: true mode: FAN_AVG } } } } } second_stage_post_processing { batch_non_max_suppression { score_threshold: 0.0 iou_threshold: 0.6 max_detections_per_class: 100 max_total_detections: 100 } score_converter: SOFTMAX } second_stage_localization_loss_weight: 2.0 second_stage_classification_loss_weight: 1.0 } }

train_config: { batch_size: 1 optimizer { momentum_optimizer: { learning_rate: { manual_step_learning_rate { initial_learning_rate: 0.00006 schedule { step: 6000000 learning_rate: .000006 } schedule { step: 7000000 learning_rate: .0000006 } } } momentum_optimizer_value: 0.9 } use_moving_average: false } gradient_clipping_by_norm: 10.0 fine_tune_checkpoint_type: "detection" from_detection_checkpoint: true fine_tune_checkpoint: "C:/Automation/models-master/research/object_detection/training/model.ckpt" num_steps: 10000000 data_augmentation_options { random_horizontal_flip { } } }

train_input_reader: { tf_record_input_reader { input_path: "C:/Automation/models-master/research/object_detection/train.record" } label_map_path: "C:/Automation/models-master/research/object_detection/training/labelmap.pbtxt" }

eval_config: { metrics_set: "open_images_V2_detection_metrics" }

eval_input_reader: { sample_1_of_n_examples: 67 tf_record_input_reader { input_path: "C:/Automation/models-master/research/object_detection/test.record" } label_map_path: "C:/Automation/models-master/research/object_detection/training/labelmap.pbtxt" shuffle: false num_readers: 1 }