実現したいこと
現在 github 上にある"tensorflow object detection api" を利用して独自のデータセットを用意して学習をさせていと思っています.
tensorflow object detection api
object_detection/train.py を実行するために前処理を行いました.
youtubeでのマカロニチーズを検出する動画を参考にさせていただきました.
TensorFlow Object Detection API Tutorial p.1
問題点
用意したものは model/research/object_detection に移動しました.
object_detection
-images
--images.png
--images.xml
--test
---images.png
---images.xml
--train
---images.png
---images.xml
-data
--test.record
--train.record
-training
--ssd_mobilenet_v1_pets.config
-ssd_mobilenet_v1_coco_11_06_2017
--frozen_inference_graph.pb
--graph.pbtxt
--model.ckpt.data-00000-of-00001
--model.ckpt.index
--model.ckpt.meta
上記のものを移動しました.
imagesの中に入っているimages.png は複数の画像が入っています.
python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config
上記のコマンドで学習を始めました.
その後
INFO:tensorflow:depth of additional conv before box predictor: 0 INFO:tensorflow:depth of additional conv before box predictor: 0 INFO:tensorflow:depth of additional conv before box predictor: 0 INFO:tensorflow:depth of additional conv before box predictor: 0 INFO:tensorflow:depth of additional conv before box predictor: 0 INFO:tensorflow:Summary name /clone_loss is illegal;usingclone_loss instead.
と表示され,tensorflow に関する情報が流れ
INFO:tensorflow:Starting Session. INFO:tensorflow:Saving checkpoint to path training/model.ckpt INFO:tensorflow:Starting Queues. INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:Saving checkpoint to path training/model.ckpt INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:Saving checkpoint to path training/model.ckpt INFO:tensorflow:Saving checkpoint to path training/model.ckpt INFO:tensorflow:Saving checkpoint to path training/model.ckpt ………
上記のようなものが表示されて学習が終了しませんでした.
メッセージからも正しく学習が開始されているように見えませんでした.
batch_size:24
num_terms:20000
"INFO:tensorflow:global_step/sec: 0" が表示されるまでにおよそ1分ほどかかっています.
以下は"ssd_mobilenet_v1_pets.config"の内容です.
ssd_mobilenet_v1_pets.config
1# SSD with Mobilenet v1, configured for Oxford-IIIT Pets Dataset. 2# Users should configure the fine_tune_checkpoint field in the train config as 3# well as the label_map_path and input_path fields in the train_input_reader and 4# eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that 5# should be configured. 6 7model { 8 ssd { 9 num_classes: 1 10 box_coder { 11 faster_rcnn_box_coder { 12 y_scale: 10.0 13 x_scale: 10.0 14 height_scale: 5.0 15 width_scale: 5.0 16 } 17 } 18 matcher { 19 argmax_matcher { 20 matched_threshold: 0.5 21 unmatched_threshold: 0.5 22 ignore_thresholds: false 23 negatives_lower_than_unmatched: true 24 force_match_for_each_row: true 25 } 26 } 27 similarity_calculator { 28 iou_similarity { 29 } 30 } 31 anchor_generator { 32 ssd_anchor_generator { 33 num_layers: 6 34 min_scale: 0.2 35 max_scale: 0.95 36 aspect_ratios: 1.0 37 aspect_ratios: 2.0 38 aspect_ratios: 0.5 39 aspect_ratios: 3.0 40 aspect_ratios: 0.3333 41 } 42 } 43 image_resizer { 44 fixed_shape_resizer { 45 height: 300 46 width: 300 47 } 48 } 49 box_predictor { 50 convolutional_box_predictor { 51 min_depth: 0 52 max_depth: 0 53 num_layers_before_predictor: 0 54 use_dropout: false 55 dropout_keep_probability: 0.8 56 kernel_size: 1 57 box_code_size: 4 58 apply_sigmoid_to_scores: false 59 conv_hyperparams { 60 activation: RELU_6, 61 regularizer { 62 l2_regularizer { 63 weight: 0.00004 64 } 65 } 66 initializer { 67 truncated_normal_initializer { 68 stddev: 0.03 69 mean: 0.0 70 } 71 } 72 batch_norm { 73 train: true, 74 scale: true, 75 center: true, 76 decay: 0.9997, 77 epsilon: 0.001, 78 } 79 } 80 } 81 } 82 feature_extractor { 83 type: 'ssd_mobilenet_v1' 84 min_depth: 16 85 depth_multiplier: 1.0 86 conv_hyperparams { 87 activation: RELU_6, 88 regularizer { 89 l2_regularizer { 90 weight: 0.00004 91 } 92 } 93 initializer { 94 truncated_normal_initializer { 95 stddev: 0.03 96 mean: 0.0 97 } 98 } 99 batch_norm { 100 train: true, 101 scale: true, 102 center: true, 103 decay: 0.9997, 104 epsilon: 0.001, 105 } 106 } 107 } 108 loss { 109 classification_loss { 110 weighted_sigmoid { 111 anchorwise_output: true 112 } 113 } 114 localization_loss { 115 weighted_smooth_l1 { 116 anchorwise_output: true 117 } 118 } 119 hard_example_miner { 120 num_hard_examples: 3000 121 iou_threshold: 0.99 122 loss_type: CLASSIFICATION 123 max_negatives_per_positive: 3 124 min_negatives_per_image: 0 125 } 126 classification_weight: 1.0 127 localization_weight: 1.0 128 } 129 normalize_loss_by_num_matches: true 130 post_processing { 131 batch_non_max_suppression { 132 score_threshold: 1e-8 133 iou_threshold: 0.6 134 max_detections_per_class: 100 135 max_total_detections: 100 136 } 137 score_converter: SIGMOID 138 } 139 } 140} 141 142train_config: { 143 batch_size: 24 144 optimizer { 145 rms_prop_optimizer: { 146 learning_rate: { 147 exponential_decay_learning_rate { 148 initial_learning_rate: 0.004 149 decay_steps: 800720 150 decay_factor: 0.95 151 } 152 } 153 momentum_optimizer_value: 0.9 154 decay: 0.9 155 epsilon: 1.0 156 } 157 } 158 fine_tune_checkpoint: "ssd_mobilenet_v1_coco_11_06_2017/model.ckpt" 159 from_detection_checkpoint: true 160 # Note: The below line limits the training process to 200K steps, which we 161 # empirically found to be sufficient enough to train the pets dataset. This 162 # effectively bypasses the learning rate schedule (the learning rate will 163 # never decay). Remove the below line to train indefinitely. 164 num_steps: 200000 165 data_augmentation_options { 166 random_horizontal_flip { 167 } 168 } 169 data_augmentation_options { 170 ssd_random_crop { 171 } 172 } 173} 174 175train_input_reader: { 176 tf_record_input_reader { 177 input_path: "data/train.record" 178 } 179 label_map_path: "data/object-detection.pbtxt" 180} 181 182eval_config: { 183 num_examples: 2000 184 # Note: The below line limits the evaluation process to 10 evaluations. 185 # Remove the below line to evaluate indefinitely. 186 max_evals: 10 187} 188 189eval_input_reader: { 190 tf_record_input_reader { 191 input_path: "data/test.record" 192 } 193 label_map_path: "data/object-detection.pbtxt" 194 shuffle: false 195 num_readers: 1 196} 197
環境
OS : windows8
プロセッサ : Intel(R)Core(TM)i5-4590 CPU @ 3.30GHz
RAM : 8.00GB
64bit オペレーティングシステム
参考にさせていただいたyoutubeの動画ではUbuntuを利用していたため,ここまでにも動画と違いうところはありました.
現在解決の糸口が見つからず困っています.
少しでも何かわかる方は教えていただきたいです.
よろしくお願いいたします.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/11/28 08:08
2017/11/28 08:49
2017/11/29 08:57
2017/11/29 09:50
2017/11/29 10:03
2017/11/29 12:29
2017/11/29 13:26
2017/11/29 13:33
2017/11/30 16:35
2017/11/30 16:43