其他分享
首页 > 其他分享> > Detectron2 基准测试 | 十二

Detectron2 基准测试 | 十二

作者:互联网

作者|facebookresearch
编译|Flin
来源|Github

基准测试

在这里,我们以一些其他流行的开源Mask R-CNN实现为基准,对Detectron2中Mask R-CNN的训练速度进行了基准测试。

设置

主要结果

工具吞吐率(img / s)
Detectron259
maskrcnn-benchmark51
tensorpack 50
mmdetection41
simpledet39
Detectron19
matterport/Mask_RCNN14
每个实现的链接:

每个实现的详细信息:

请注意,此实现中的许多小细节可能与Detectron的标准不同。

(diff使其使用相同的超参数-单击展开)
diff --git i/mrcnn/model.py w/mrcnn/model.py
index 62cb2b0..61d7779 100644
--- i/mrcnn/model.py
+++ w/mrcnn/model.py
@@ -2367,8 +2367,8 @@ class MaskRCNN():
      epochs=epochs,
      steps_per_epoch=self.config.STEPS_PER_EPOCH,
      callbacks=callbacks,
-            validation_data=val_generator,
-            validation_steps=self.config.VALIDATION_STEPS,
+            #validation_data=val_generator,
+            #validation_steps=self.config.VALIDATION_STEPS,
      max_queue_size=100,
      workers=workers,
      use_multiprocessing=True,
diff --git i/mrcnn/parallel_model.py w/mrcnn/parallel_model.py
index d2bf53b..060172a 100644
--- i/mrcnn/parallel_model.py
+++ w/mrcnn/parallel_model.py
@@ -32,6 +32,7 @@ class ParallelModel(KM.Model):
    keras_model: The Keras model to parallelize
    gpu_count: Number of GPUs. Must be > 1
    """
+        super().__init__()
    self.inner_model = keras_model
    self.gpu_count = gpu_count
    merged_outputs = self.make_parallel()
diff --git i/samples/coco/coco.py w/samples/coco/coco.py
index 5d172b5..239ed75 100644
--- i/samples/coco/coco.py
+++ w/samples/coco/coco.py
@@ -81,7 +81,10 @@ class CocoConfig(Config):
  IMAGES_PER_GPU = 2

  # Uncomment to train on 8 GPUs (default is 1)
-    # GPU_COUNT = 8
+    GPU_COUNT = 8
+    BACKBONE = "resnet50"
+    STEPS_PER_EPOCH = 50
+    TRAIN_ROIS_PER_IMAGE = 512

  # Number of classes (including background)
  NUM_CLASSES = 1 + 80  # COCO has 80 classes
@@ -496,29 +499,10 @@ if __name__ == '__main__':
    # *** This training schedule is an example. Update to your needs ***

    # Training - Stage 1
-        print("Training network heads")
    model.train(dataset_train, dataset_val,
          learning_rate=config.LEARNING_RATE,
          epochs=40,
-                    layers='heads',
-                    augmentation=augmentation)
-
-        # Training - Stage 2
-        # Finetune layers from ResNet stage 4 and up
-        print("Fine tune Resnet stage 4 and up")
-        model.train(dataset_train, dataset_val,
-                    learning_rate=config.LEARNING_RATE,
-                    epochs=120,
-                    layers='4+',
-                    augmentation=augmentation)
-
-        # Training - Stage 3
-        # Fine tune all layers
-        print("Fine tune all layers")
-        model.train(dataset_train, dataset_val,
-                    learning_rate=config.LEARNING_RATE / 10,
-                    epochs=160,
-                    layers='all',
+                    layers='3+',
          augmentation=augmentation)

  elif args.command == "evaluate":

原文链接:https://detectron2.readthedocs.io/notes/benchmarks.html

欢迎关注磐创AI博客站:
http://panchuang.net/

sklearn机器学习中文官方文档:
http://sklearn123.com/

欢迎关注磐创博客资源汇总站:
http://docs.panchuang.net/

标签:Detectron2,py,mask,十二,train,coco,model,config,基准
来源: https://www.cnblogs.com/panchuangai/p/13036569.html