Более быстрое обучение модели RCNN останавливается на GCP, выполняется локально без проблем - PullRequest
0 голосов
/ 28 ноября 2018

Попытка запустить программу на основе API обнаружения объектов Tensorflow.Более быстрая модель RCNN прекращает обучение на GCP, но работает локально без проблем.Любая обратная связь будет оценена.Пробовал разрешение роли «Запись журналов» для Service Agent, как это предлагалось в разных публикациях.Не удалось найти больше отзывов.

GCP Log

Полное сообщение об ошибке:

Мастер реплики 0 вышел сненулевой статус 1. Причина прекращения: ошибка.Трассировка (последний вызов был последним): файл "/usr/lib/python2.7/runpy.py", строка 174, в _run_module_as_main " main ", fname, загрузчик, имя pkg_name) "/ usr /lib / python2.7 / runpy.py ", строка 72, в исполняемом коде _run_code в файле run_globals" /root/.local/lib/python2.7/site-packages/object_detection/train.py ", строка 198, в tf.app.run () Файл "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", строка 48, в прогоне _sys.exit (main (_sys.argv [:1] + flags_passthrough)) Файл "/root/.local/lib/python2.7/site-packages/object_detection/train.py", строка 194, в главном файле worker_job_name, is_chief, FLAGS.train_dir) Файл "/ root /.local / lib / python2.7 / site-packages / object_detection / trainer.py ", строка 296, в заставке поезда = заставка) Файл" /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py ", строка 763, в поезде, train_op, global_step, train_step_kwargs) Файл" /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py ", строка 487, в траin_step run_metadata = run_metadata) Файл "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", строка 889, в файле run run_metadata_ptr) "/ usr / local / lib / python2.7 / dist-packages / tenorflow / python / client / session.py ", строка 1120, в _run feed_dict_tensor, options, run_metadata) Файл" /usr/local/lib/python2.7/dist-packages/tensorflow/python/client / session.py ", строка 1317, в параметрах _do_run, run_metadata) Файл" /usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py ", строка 1336, в _do_call повыситьtype (e) (node_def, op, message) UnavailableError: Ошибка чтения конечной точки Чтобы узнать больше о том, почему ваша работа завершилась, проверьте журналы: https://console.cloud.google.com/logs/viewer?project=1086278442266&resource=ml_job%2Fjob_id%2Fuav_object_detection_1543356760&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22uav_object_detection_1543356760%22

Это то, что я запускаю в Терминалечтобы начать обучение:

gcloud ml-engine jobs submit training `whoami`_object_detection_`date +%s` \
   --job-dir=gs://my_gcs_bucket/train \
   --packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz \
   --module-name object_detection.train \
   --region us-central1 \
   --config object_detection/samples/cloud/cloud.yml \
   --runtime-version=1.4 \
   -- \
   --train_dir=gs://my_gcs_bucket/train \
   --pipeline_config_path=gs://my_gcs_bucket/data/faster_rcnn_resnet101.config

Это моя файловая структура в GCP Bucket

+ data/
  - faster_rcnn_resnet101.config
  - model.ckpt.index
  - model.ckpt.meta
  - model.ckpt.data-00000-of-00001
  - pet_label_map.pbtxt
  - train.record
  - val.record
+ train/

Это моя файловая структура в папке, из которой я запускаю

+dist/
  -object_detection-0.1.tar.gz
+object_detection/
+object_detection.egg-info/
+slim/
setup.py

Файл конфигурации:

# Faster R-CNN with Resnet-101 (v1) configured for the Oxford-IIIT Pet Dataset.
# Users should configure the fine_tune_checkpoint field in the train config as
# well as the label_map_path and input_path fields in the train_input_reader and
# eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that
# should be configured.

model {
  faster_rcnn {
    num_classes: 1
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 600
        max_dimension: 1024
      }
    }
    feature_extractor {
      type: 'faster_rcnn_resnet101'
      first_stage_features_stride: 16
    }
    first_stage_anchor_generator {
      grid_anchor_generator {
        scales: [0.25, 0.5, 1.0, 2.0]
        aspect_ratios: [0.5, 1.0, 2.0]
        height_stride: 16
        width_stride: 16
      }
    }
    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: 14
    maxpool_kernel_size: 2
    maxpool_stride: 2
    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: 300
      }
      score_converter: SOFTMAX
    }
    second_stage_localization_loss_weight: 2.0
    second_stage_classification_loss_weight: 1.0
  }
}

train_config: {
  batch_size: 1
  batch_queue_capacity: 1
  num_batch_queue_threads: 1
  prefetch_queue_capacity: 1
  optimizer {
    momentum_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.0003
          schedule {
            step: 0
            learning_rate: .0003
          }
          schedule {
            step: 900000
            learning_rate: .00003
          }
          schedule {
            step: 1200000
            learning_rate: .000003
          }
        }
      }
      momentum_optimizer_value: 0.9
    }
    use_moving_average: false
  }
  gradient_clipping_by_norm: 10.0
  fine_tune_checkpoint: "gs://my_gcs_bucket/data/model.ckpt"
  from_detection_checkpoint: true
  # Note: The below line limits the training process to 200K steps, which we
  # empirically found to be sufficient enough to train the pets dataset. This
  # effectively bypasses the learning rate schedule (the learning rate will
  # never decay). Remove the below line to train indefinitely.
  num_steps:2000
  data_augmentation_options {
    random_horizontal_flip {
    }
  }
}

train_input_reader: {
  tf_record_input_reader {
    input_path: "gs://my_gcs_bucket/data/data/train.record"
  }
  label_map_path: "gs://my_gcs_bucket/data/data/label_map.pbtxt"
  queue_capacity: 10
  min_after_dequeue: 5
}

eval_config: {
  num_examples: 4
  # Note: The below line limits the evaluation process to 10 evaluations.
  # Remove the below line to evaluate indefinitely.
  max_evals: 10
}

eval_input_reader: {
  tf_record_input_reader {
    input_path: "gs://my_gcs_bucket/data/data/val.record"
  }
  label_map_path: "gs://my_gcs_bucket/data/data/label_map.pbtxt"
  shuffle: false
  num_readers: 1
}

1 Ответ

0 голосов
/ 29 ноября 2018

Изменена версия среды выполнения до 1.2 в cloud.yml и начальном запросе.

...