maskrcnn_benchmark 代码详解之 modeling/rpn/utils.py

本文详细解析了maskrcnn_benchmark库中modeling/rpn/utils.py文件的功能,特别是针对采用FPN的RPN层如何融合不同层的特征图进行介绍。该工具类有助于实现FPN特征的统一处理和损失计算。

前言:

  在backbone如果采用了FPN, 则RPN层需要将FPN的不同层得到的特征图进行融合。maskrcnn_benchmark将该多层融合的工具函数写入了modeling/rpn/utils.py中,通过该工具类,可以将不同层的特征融合起来,进行统一处理。其代码详解为:

# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""
Utility functions minipulating the prediction layers
"""

from ..utils import cat

import torch


# todo 改变特征层的维度
def permute_and_flatten(layer, N, A, C, H, W):
    # 将特征层格式化为特定的维度数据
    layer = layer.view(N, -1, C, H, W)
    # 改变特征层中不同维度之间的显示顺序
    layer = layer.permute(0, 3, 4, 1, 2)
    # 将特征层中除了通道数和图片数以外的其他维度合并在一起
    layer = layer.reshape(N, -1, C)
    return layer


# todo 将所有的特征图拼接到一起
def concat_box_prediction_layers(box_cls, box_regression):
    """
    由RPN HEAD获得的box_cls和box_regression分别表示从FPN获得的不同层的特征图上
    将通道数分别修正为锚点(anchor)的ratio个数和其个数×4
    RPN HEAD获得的特征图大小的含义为:每一个特征图上每一个位置的一个点表示其位置对应的锚点
        不同的特征图代表不同的锚点大小,特征图大小越大对应的锚点即越小
    box_cls和box_regression的通道数含义:box_cls的通道为ratio个数表示每一个通道对应每一种rati
Stored in directory: /tmp/pip-ephem-wheel-cache-di294vqy/wheels/3d/6e/b3/63d5237bbf06b75024f88ff227ac2d77a7a6b77663f01dade2 DEPRECATION: Building 'detectron2' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'detectron2'. Discussion can be found at https://github.com/pypa/pip/issues/6334 Building wheel for detectron2 (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [434 lines of output] running bdist_wheel /home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) running build running build_py creating build/lib.linux-x86_64-cpython-310/detectron2 copying detectron2/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2 creating build/lib.linux-x86_64-cpython-310/tools copying tools/benchmark.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/__init__.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/convert-torchvision-to-d2.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/analyze_model.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/visualize_json_results.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/train_net.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/plain_train_net.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/visualize_data.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/lazyconfig_train_net.py -> build/lib.linux-x86_64-cpython-310/tools copying tools/lightning_train_net.py -> build/lib.linux-x86_64-cpython-310/tools creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo copying detectron2/model_zoo/model_zoo.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo copying detectron2/model_zoo/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo creating build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/panoptic_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/testing.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/evaluator.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/pascal_voc_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/fast_eval_api.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/rotated_coco_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/sem_seg_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/lvis_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/coco_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation copying detectron2/evaluation/cityscapes_evaluation.py -> build/lib.linux-x86_64-cpython-310/detectron2/evaluation creating build/lib.linux-x86_64-cpython-310/detectron2/config copying detectron2/config/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/config copying detectron2/config/compat.py -> build/lib.linux-x86_64-cpython-310/detectron2/config copying detectron2/config/defaults.py -> build/lib.linux-x86_64-cpython-310/detectron2/config copying detectron2/config/lazy.py -> build/lib.linux-x86_64-cpython-310/detectron2/config copying detectron2/config/instantiate.py -> build/lib.linux-x86_64-cpython-310/detectron2/config copying detectron2/config/config.py -> build/lib.linux-x86_64-cpython-310/detectron2/config creating build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/vanilla_hungarian_bbox_iou_tracker.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/hungarian_tracker.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/bbox_iou_tracker.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/iou_weighted_hungarian_bbox_iou_tracker.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/utils.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking copying detectron2/tracking/base_tracker.py -> build/lib.linux-x86_64-cpython-310/detectron2/tracking creating build/lib.linux-x86_64-cpython-310/detectron2/engine copying detectron2/engine/hooks.py -> build/lib.linux-x86_64-cpython-310/detectron2/engine copying detectron2/engine/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/engine copying detectron2/engine/defaults.py -> build/lib.linux-x86_64-cpython-310/detectron2/engine copying detectron2/engine/train_loop.py -> build/lib.linux-x86_64-cpython-310/detectron2/engine copying detectron2/engine/launch.py -> build/lib.linux-x86_64-cpython-310/detectron2/engine creating build/lib.linux-x86_64-cpython-310/detectron2/solver copying detectron2/solver/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/solver copying detectron2/solver/build.py -> build/lib.linux-x86_64-cpython-310/detectron2/solver copying detectron2/solver/lr_scheduler.py -> build/lib.linux-x86_64-cpython-310/detectron2/solver creating build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/testing.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/env.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/logger.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/registry.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/analysis.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/visualizer.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/develop.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/collect_env.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/tracing.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/video_visualizer.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/file_io.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/memory.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/events.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/comm.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/serialize.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/torch_version_utils.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils copying detectron2/utils/colormap.py -> build/lib.linux-x86_64-cpython-310/detectron2/utils creating build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/poolers.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/matcher.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/test_time_augmentation.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/anchor_generator.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/box_regression.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/postprocessing.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/sampling.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling copying detectron2/modeling/mmdet_wrapper.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling creating build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/benchmark.py -> build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/build.py -> build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/catalog.py -> build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/dataset_mapper.py -> build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/detection_utils.py -> build/lib.linux-x86_64-cpython-310/detectron2/data copying detectron2/data/common.py -> build/lib.linux-x86_64-cpython-310/detectron2/data creating build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/caffe2_inference.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/torchscript_patch.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/flatten.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/api.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/caffe2_modeling.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/caffe2_export.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/c10.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/torchscript.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/caffe2_patch.py -> build/lib.linux-x86_64-cpython-310/detectron2/export copying detectron2/export/shared.py -> build/lib.linux-x86_64-cpython-310/detectron2/export creating build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/keypoints.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/instances.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/boxes.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/rotated_boxes.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/masks.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures copying detectron2/structures/image_list.py -> build/lib.linux-x86_64-cpython-310/detectron2/structures creating build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/shape_spec.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/mask_ops.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/blocks.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/deform_conv.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/losses.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/roi_align.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/rotated_boxes.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/wrappers.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/batch_norm.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/roi_align_rotated.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/aspp.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers copying detectron2/layers/nms.py -> build/lib.linux-x86_64-cpython-310/detectron2/layers creating build/lib.linux-x86_64-cpython-310/detectron2/projects copying detectron2/projects/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects creating build/lib.linux-x86_64-cpython-310/detectron2/checkpoint copying detectron2/checkpoint/c2_model_loading.py -> build/lib.linux-x86_64-cpython-310/detectron2/checkpoint copying detectron2/checkpoint/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/checkpoint copying detectron2/checkpoint/catalog.py -> build/lib.linux-x86_64-cpython-310/detectron2/checkpoint copying detectron2/checkpoint/detection_checkpoint.py -> build/lib.linux-x86_64-cpython-310/detectron2/checkpoint creating build/lib.linux-x86_64-cpython-310/detectron2/modeling/proposal_generator copying detectron2/modeling/proposal_generator/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/proposal_generator copying detectron2/modeling/proposal_generator/rrpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/proposal_generator copying detectron2/modeling/proposal_generator/rpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/proposal_generator copying detectron2/modeling/proposal_generator/build.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/proposal_generator copying detectron2/modeling/proposal_generator/proposal_utils.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/proposal_generator creating build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/build.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/resnet.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/backbone.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/swin.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/vit.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/mvit.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/regnet.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/fpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone copying detectron2/modeling/backbone/utils.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/backbone creating build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/fcos.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/rcnn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/semantic_seg.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/build.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/dense_detector.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/panoptic_fpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch copying detectron2/modeling/meta_arch/retinanet.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/meta_arch creating build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/rotated_fast_rcnn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/keypoint_head.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/fast_rcnn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/cascade_rcnn.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/mask_head.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/roi_heads.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads copying detectron2/modeling/roi_heads/box_head.py -> build/lib.linux-x86_64-cpython-310/detectron2/modeling/roi_heads creating build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/register_coco.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/builtin_meta.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/coco.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/lvis_v0_5_categories.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/pascal_voc.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/cityscapes_panoptic.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/coco_panoptic.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/builtin.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/lvis.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/lvis_v1_category_image_count.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/cityscapes.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets copying detectron2/data/datasets/lvis_v1_categories.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/datasets creating build/lib.linux-x86_64-cpython-310/detectron2/data/transforms copying detectron2/data/transforms/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/transforms copying detectron2/data/transforms/transform.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/transforms copying detectron2/data/transforms/augmentation_impl.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/transforms copying detectron2/data/transforms/augmentation.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/transforms creating build/lib.linux-x86_64-cpython-310/detectron2/data/samplers copying detectron2/data/samplers/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/samplers copying detectron2/data/samplers/distributed_sampler.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/samplers copying detectron2/data/samplers/grouped_batch_sampler.py -> build/lib.linux-x86_64-cpython-310/detectron2/data/samplers creating build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/semantic_seg.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/mask_head.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/roi_heads.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/color_augmentation.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/point_head.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/point_features.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend copying projects/PointRend/point_rend/config.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/point_rend creating build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/semantic_seg.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/build_solver.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/resnet.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/lr_scheduler.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/config.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab copying projects/DeepLab/deeplab/loss.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/deeplab creating build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab copying projects/Panoptic-DeepLab/panoptic_deeplab/target_generator.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab copying projects/Panoptic-DeepLab/panoptic_deeplab/panoptic_seg.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab copying projects/Panoptic-DeepLab/panoptic_deeplab/__init__.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab copying projects/Panoptic-DeepLab/panoptic_deeplab/dataset_mapper.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab copying projects/Panoptic-DeepLab/panoptic_deeplab/post_processing.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab copying projects/Panoptic-DeepLab/panoptic_deeplab/config.py -> build/lib.linux-x86_64-cpython-310/detectron2/projects/panoptic_deeplab creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs copying detectron2/model_zoo/configs/Base-RCNN-C4.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs copying detectron2/model_zoo/configs/Base-RCNN-DilatedC5.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs copying detectron2/model_zoo/configs/Base-RetinaNet.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs copying detectron2/model_zoo/configs/Base-RCNN-FPN.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/PascalVOC-Detection copying detectron2/model_zoo/configs/PascalVOC-Detection/faster_rcnn_R_50_C4.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/PascalVOC-Detection copying detectron2/model_zoo/configs/PascalVOC-Detection/faster_rcnn_R_50_FPN.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/PascalVOC-Detection creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation copying detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation copying detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation copying detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation/mask_rcnn_R_101_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv0.5-InstanceSegmentation creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv1-InstanceSegmentation copying detectron2/model_zoo/configs/LVISv1-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv1-InstanceSegmentation copying detectron2/model_zoo/configs/LVISv1-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv1-InstanceSegmentation copying detectron2/model_zoo/configs/LVISv1-InstanceSegmentation/mask_rcnn_R_101_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/LVISv1-InstanceSegmentation creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints copying detectron2/model_zoo/configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints copying detectron2/model_zoo/configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints copying detectron2/model_zoo/configs/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints copying detectron2/model_zoo/configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints copying detectron2/model_zoo/configs/COCO-Keypoints/Base-Keypoint-RCNN-FPN.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Detectron1-Comparisons copying detectron2/model_zoo/configs/Detectron1-Comparisons/keypoint_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Detectron1-Comparisons copying detectron2/model_zoo/configs/Detectron1-Comparisons/mask_rcnn_R_50_FPN_noaug_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Detectron1-Comparisons copying detectron2/model_zoo/configs/Detectron1-Comparisons/faster_rcnn_R_50_FPN_noaug_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Detectron1-Comparisons creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/rpn_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/panoptic_fpn_R_50_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/semantic_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/keypoint_rcnn_R_50_FPN_normalized_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/semantic_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/keypoint_rcnn_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_FPN_pred_boxes_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/fast_rcnn_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_C4_GCV_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_C4_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/semantic_R_50_FPN_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/retinanet_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/panoptic_fpn_R_50_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/panoptic_fpn_R_50_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_C4_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_FPN_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/keypoint_rcnn_R_50_FPN_training_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/retinanet_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/cascade_mask_rcnn_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/fast_rcnn_R_50_FPN_instant_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/keypoint_rcnn_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/rpn_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_DC5_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/cascade_mask_rcnn_R_50_FPN_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules copying detectron2/model_zoo/configs/quick_schedules/mask_rcnn_R_50_C4_inference_acc_test.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/quick_schedules creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/retinanet_R_50_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/rpn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/rpn_R_50_C4_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Cityscapes copying detectron2/model_zoo/configs/Cityscapes/mask_rcnn_R_50_FPN.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Cityscapes creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x_giou.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/cascade_mask_rcnn_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/scratch_mask_rcnn_R_50_FPN_9x_syncbn.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/mask_rcnn_R_50_FPN_3x_gn.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/scratch_mask_rcnn_R_50_FPN_9x_gn.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/mask_rcnn_R_50_FPN_1x_cls_agnostic.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/cascade_mask_rcnn_R_50_FPN_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/semantic_R_50_FPN_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/mask_rcnn_R_50_FPN_3x_syncbn.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-PanopticSegmentation copying detectron2/model_zoo/configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-PanopticSegmentation copying detectron2/model_zoo/configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-PanopticSegmentation copying detectron2/model_zoo/configs/COCO-PanopticSegmentation/Base-Panoptic-FPN.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-PanopticSegmentation copying detectron2/model_zoo/configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-PanopticSegmentation creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_101_FPN_400ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_50_FPN_400ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_101_FPN_200ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_101_FPN_100ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_50_FPN_100ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_50_FPN_50ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/new_baselines/mask_rcnn_R_50_FPN_200ep_LSJ.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/new_baselines copying detectron2/model_zoo/configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Keypoints copying detectron2/model_zoo/configs/COCO-Detection/fcos_R_50_FPN_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection copying detectron2/model_zoo/configs/COCO-Detection/retinanet_R_50_FPN_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-Detection creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common copying detectron2/model_zoo/configs/common/optim.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common copying detectron2/model_zoo/configs/common/train.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common copying detectron2/model_zoo/configs/common/coco_schedule.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/mask_rcnn_fpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/mask_rcnn_c4.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/fcos.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/cascade_rcnn.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/keypoint_rcnn_fpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/panoptic_fpn.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/retinanet.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models copying detectron2/model_zoo/configs/common/models/mask_rcnn_vitdet.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/models creating build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/data copying detectron2/model_zoo/configs/common/data/coco_keypoint.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/data copying detectron2/model_zoo/configs/common/data/coco.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/data copying detectron2/model_zoo/configs/common/data/constants.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/data copying detectron2/model_zoo/configs/common/data/coco_panoptic_separated.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/common/data copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_regnety_4gf_dds_fpn_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/COCO-InstanceSegmentation/mask_rcnn_regnetx_4gf_dds_fpn_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-InstanceSegmentation copying detectron2/model_zoo/configs/Misc/mmdet_mask_rcnn_R_50_FPN_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/Misc/torchvision_imagenet_R_50.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/Misc copying detectron2/model_zoo/configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.py -> build/lib.linux-x86_64-cpython-310/detectron2/model_zoo/configs/COCO-PanopticSegmentation running build_ext building 'detectron2._C' extension creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/ROIAlignRotated creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/box_iou_rotated creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/cocoeval creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/deformable creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/nms_rotated g++ -pthread -B /home/tj/miniconda3/envs/hamer/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/tj/miniconda3/envs/hamer/include -fPIC -O2 -isystem /home/tj/miniconda3/envs/hamer/include -fPIC -DWITH_CUDA -I/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc -I/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/include -I/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/include/TH -I/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda-11.7/include -I/home/tj/miniconda3/envs/hamer/include/python3.10 -c /tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp -o build/temp.linux-x86_64-cpython-310/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 35, in <module> File "/tmp/pip-install-yed5c_5d/detectron2_a449e534cbf24e4994b5ed9b49af7121/setup.py", line 151, in <module> setup( File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands self.run_command(cmd) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 370, in run self.run_command("build") File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run self.build_extensions() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions build_ext.build_extensions(self) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 484, in build_extensions self._build_extensions_serial() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 510, in _build_extensions_serial self.build_extension(ext) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 264, in build_extension _build_ext.build_extension(self, ext) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 565, in build_extension objects = self.compiler.compile( File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/compilers/C/base.py", line 655, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 581, in unix_wrap_single_compile cflags = unix_cuda_flags(cflags) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 548, in unix_cuda_flags cflags + _get_cuda_arch_flags(cflags)) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1760, in _get_cuda_arch_flags capability = torch.cuda.get_device_capability(i) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/cuda/__init__.py", line 381, in get_device_capability prop = get_device_properties(device) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/cuda/__init__.py", line 395, in get_device_properties _lazy_init() # will define _get_device_properties File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/cuda/__init__.py", line 247, in _lazy_init torch._C._cuda_init() RuntimeError: Unrecognized CachingAllocator option: expandable_segments [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for detectron2 Running setup.py clean for detectron2 Successfully built chumpy Failed to build detectron2 error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> detectron2
最新发布
10-06
Traceback (most recent call last): File "tools/extract_clip_feature.py", line 20, in <module> from maskrcnn_benchmark.data import make_data_loader File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/data/__init__.py", line 2, in <module> from .build import make_data_loader, get_dataset_statistics File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/data/build.py", line 12, in <module> from maskrcnn_benchmark.utils.miscellaneous import save_labels File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/utils/miscellaneous.py", line 10, in <module> from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/structures/boxlist_ops.py", line 7, in <module> from maskrcnn_benchmark.layers import nms as _box_nms File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/layers/__init__.py", line 10, in <module> from .nms import nms File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/layers/nms.py", line 3, in <module> from ._utils import _C File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/layers/_utils.py", line 39, in <module> _C = _load_C_extensions() File "/root/.cache/huggingface/forget/lab/shichong/cyy/RECODE/maskrcnn_benchmark/layers/_utils.py", line 35, in _load_C_extensions extra_include_paths=extra_include_paths, File "/opt/conda/envs/recode/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1296, in load keep_intermediates=keep_intermediates) File "/opt/conda/envs/recode/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1534, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "/opt/conda/envs/recode/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1936, in _import_module_from_library module = importlib.util.module_from_spec(spec) ImportError: /root/.cache/torch_extensions/py37_cu117/torchvision/torchvision.so: cannot open shared object file: No such file or directory
06-24
### 解决方案 以下是关于解决 `ImportError: cannot import name '_C' from 'maskrcnn_benchmark'` 的详细分析与解决方案。 #### 问题背景 错误的核心是无法正确导入 `_C` 模块。此模块通常是通过编译 C++ 或 CUDA 扩展代码生成的共享对象文件(如 `_C.so`),存储在 `maskrcnn_benchmark/_C.*.so` 中。如果该文件缺失或未正确生成,则会导致上述错误[^1]。 #### 环境依赖检查 确保安装了所有必要的依赖项,包括正确的 PyTorch、CUDA 和其他相关库版本。可以通过以下命令验证 PyTorch 是否正确安装以及是否支持 CUDA: ```python import torch print(torch.__version__) print(torch.cuda.is_available()) ``` 如果 CUDA 不可用或 PyTorch 版本与 CUDA 版本不匹配,可能导致编译失败。确保 PyTorch 版本与 CUDA 版本兼容[^2]。 #### 编译扩展模块 如果 `_C.so` 文件不存在或损坏,需要重新编译扩展模块。进入 `maskrcnn-benchmark` 源码目录并运行以下命令以重新构建模块: ```bash python setup.py build develop ``` 此命令会尝试重新编译 `_C` 模块。如果出现类似 `Microsoft Visual C++ 14.0 is required` 的错误,说明缺少必要的编译工具链。可以通过安装 Microsoft Visual Studio 来解决这个问题[^3]。 #### 替换导入路径 根据引用内容,可以尝试将 `from maskrcnn_benchmark import _C` 替换为 `from ._utils import _C`。此方法适用于某些特定场景,但需确保 `_utils` 模块存在且包含 `_C` 定义[^4]。 #### 检查源码完整性 如果上述方法无效,可能是源码本身存在问题。建议从官方 GitHub 仓库重新下载最新版本的 `maskrcnn-benchmark` 源码,并按照官方文档重新配置和编译[^5]。 #### 单卡训练验证 使用单卡训练脚本验证环境是否正常工作。运行以下命令进行测试: ```bash python /path_to_maskrcnn_benchmark/tools/train_net.py --config-file "/path/to/config/file.yaml" ``` 如果训练脚本能够正常运行,则表明问题已解决[^6]。 #### 示例代码修正 以下是修正后的代码片段(假设使用了替代导入路径): ```python # 原始代码 from maskrcnn_benchmark import _C # 替代代码 from ._utils import _C # 替换为正确的导入路径 ``` 如果上述修改无效,建议检查 `_C` 模块的生成过程,确保其正确编译。 --- ###
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值