PyTorch implementation of DARDet: A Dense Anchor-free Rotated Object Detector in Aerial Images

Related tags

Deep Learning DARDet
Overview

DARDet

PyTorch implementation of "DARDet: A Dense Anchor-free Rotated Object Detector in Aerial Images", [pdf].

Highlights:

1. We develop a new dense anchor-free rotated object detection architecture (DARDet), which directly predicts five parameters of OBB at each spatial location.

2. Our DARDet significantly achieve state-of-the-art performance on the DOTA, UCAS-AOD, and HRSC2016 datasets with high efficiency..

Benchmark and model zoo, with extracting code nudt.

Model Backbone MS Rotate Lr schd Inf time (fps) box AP Download
DARDet R-50-FPN - - 1x 12.7 77.61 cfgmodel
DARDet R-50-FPN - 2x 12.7 78.74 cfgmodel

Installation

Prerequisites

  • Linux or macOS (Windows is in experimental support)
  • Python 3.6+
  • PyTorch 1.3+
  • CUDA 9.2+ (If you build PyTorch from source, CUDA 9.0 is also compatible)
  • GCC 5+
  • MMCV

The compatible MMDetection and MMCV versions are as below. Please install the correct version of MMCV to avoid installation issues.

MMDetection version MMCV version
2.13.0 mmcv-full>=1.3.3, <1.4.0

Note: You need to run pip uninstall mmcv first if you have mmcv installed. If mmcv and mmcv-full are both installed, there will be ModuleNotFoundError.

Installation

  1. You can simply install mmdetection with the following commands: pip install mmdet

  2. Create a conda virtual environment and activate it.

    conda create -n open-mmlab python=3.7 -y
    conda activate open-mmlab
  3. Install PyTorch and torchvision following the official instructions, e.g.,

    conda install pytorch torchvision -c pytorch

    Note: Make sure that your compilation CUDA version and runtime CUDA version match. You can check the supported CUDA version for precompiled packages on the PyTorch website.

    E.g.1 If you have CUDA 10.1 installed under /usr/local/cuda and would like to install PyTorch 1.5, you need to install the prebuilt PyTorch with CUDA 10.1.

    conda install pytorch cudatoolkit=10.1 torchvision -c pytorch
  4. Install mmcv-full, we recommend you to install the pre-build package as below.

    pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html

    Please replace {cu_version} and {torch_version} in the url to your desired one. For example, to install the latest mmcv-full with CUDA 11 and PyTorch 1.7.0, use the following command:

    pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html

    See here for different versions of MMCV compatible to different PyTorch and CUDA versions. Optionally you can choose to compile mmcv from source by the following command

    git clone https://github.com/open-mmlab/mmcv.git
    cd mmcv
    MMCV_WITH_OPS=1 pip install -e .  # package mmcv-full will be installed after this step
    cd ..

    Or directly run

    pip install mmcv-full
  5. Clone the DARDet repository.

    cd DARDet

    
    
  6. Install build requirements and then install DARDet

    pip install -r requirements/build.txt
    pip install -v -e .  # or "python setup.py develop"
    
  7. Install DOTA_devkit

    sudo apt-get install swig
    cd DOTA_devkit/polyiou
    swig -c++ -python csrc/polyiou.i
    python setup.py build_ext --inplace
    

Prepare DOTA dataset.

It is recommended to symlink the dataset root to `ReDet/data`.

Here, we give an example for single scale data preparation of DOTA-v1.5.

First, make sure your initial data are in the following structure.
```
data/dota15
├── train
│   ├──images
│   └── labelTxt
├── val
│   ├── images
│   └── labelTxt
└── test
    └── images
```
Split the original images and create COCO format json. 
```
python DOTA_devkit/prepare_dota1_5.py --srcpath path_to_dota --dstpath path_to_split_1024
```
Then you will get data in the following structure
```
dota15_1024
├── test1024
│   ├── DOTA_test1024.json
│   └── images
└── trainval1024
    ├── DOTA_trainval1024.json
     └── images
```
For data preparation with data augmentation, refer to "DOTA_devkit/prepare_dota1_5_v2.py"

Examples:

Assume that you have already downloaded the checkpoints to work_dirs/DARDet_r50_fpn_1x/.

  • Test DARDet on DOTA.
python tools/test.py configs/DARDet/dardet_r50_fpn_1x_dcn_val.py \
    work_dirs/dardet_r50_fpn_1x_dcn_val/epoch_12.pth \ 
    --out work_dirs/dardet_r50_fpn_1x_dcn_val/res.pkl

*If you want to evaluate the result on DOTA test-dev, zip the files in work_dirs/dardet_r50_fpn_1x_dcn_val/result_after_nms and submit it to the evaluation server.

Inference

To inference multiple images in a folder, you can run:

python demo/demo_inference.py ${CONFIG_FILE} ${CHECKPOINT} ${IMG_DIR} ${OUTPUT_DIR}

Train a model

MMDetection implements distributed training and non-distributed training, which uses MMDistributedDataParallel and MMDataParallel respectively.

All outputs (log files and checkpoints) will be saved to the working directory, which is specified by work_dir in the config file.

*Important*: The default learning rate in config files is for 8 GPUs and 2 img/gpu (batch size = 8*2 = 16). According to the Linear Scaling Rule, you need to set the learning rate proportional to the batch size if you use different GPUs or images per GPU, e.g., lr=0.01 for 4 GPUs * 2 img/gpu and lr=0.08 for 16 GPUs * 4 img/gpu.

Train with a single GPU

python tools/train.py ${CONFIG_FILE}

If you want to specify the working directory in the command, you can add an argument --work_dir ${YOUR_WORK_DIR}.

Train with multiple GPUs

./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]

Optional arguments are:

  • --validate (strongly recommended): Perform evaluation at every k (default value is 1, which can be modified like this) epochs during the training.
  • --work_dir ${WORK_DIR}: Override the working directory specified in the config file.
  • --resume_from ${CHECKPOINT_FILE}: Resume from a previous checkpoint file.

Difference between resume_from and load_from: resume_from loads both the model weights and optimizer status, and the epoch is also inherited from the specified checkpoint. It is usually used for resuming the training process that is interrupted accidentally. load_from only loads the model weights and the training epoch starts from 0. It is usually used for finetuning.

Train with multiple machines

If you run MMDetection on a cluster managed with slurm, you can use the script slurm_train.sh.

./tools/slurm_train.sh ${PARTITION} ${JOB_NAME} ${CONFIG_FILE} ${WORK_DIR} [${GPUS}]

Here is an example of using 16 GPUs to train Mask R-CNN on the dev partition.

./tools/slurm_train.sh dev mask_r50_1x configs/mask_rcnn_r50_fpn_1x.py /nfs/xxxx/mask_rcnn_r50_fpn_1x 16

You can check slurm_train.sh for full arguments and environment variables.

If you have just multiple machines connected with ethernet, you can refer to pytorch launch utility. Usually it is slow if you do not have high speed networking like infiniband.

Contact

Any question regarding this work can be addressed to [email protected].

Comments
  • TypeError: __init__() missing 4 required positional arguments: 'casting', 'from_', 'to', and 'i'

    TypeError: __init__() missing 4 required positional arguments: 'casting', 'from_', 'to', and 'i'

    作者您好!感谢您对于工作的分享!在用您的模型跑DOTA数据集以及自定义数据集时报错: File "/home/song/anaconda3/envs/DARDet/lib/python3.7/site-packages/torch/utils.py", line 395, in reraise raise self.exc_type(msg) TypeError: init() missing 4 required positional arguments: 'casting', 'from', 'to', and 'i' 可能是数据加载的问题,我按照DOTA_devkit中的DOTA2COCO进行数据集格式的转换与加载。希望您有空可以解答一下,谢谢!

    opened by songhetian834764034 13
  • 'COCO' object has no attribute 'get_cat_ids'

    'COCO' object has no attribute 'get_cat_ids'

    First of all, thank you for your contribution.I encountered the following problems when reproducing your code.Rsaicp2_new is my own dataset.When I tried to train, the following problems occurred.

    error:

    Traceback (most recent call last):
      File "tools/train.py", line 190, in <module>
        main()
      File "tools/train.py", line 167, in main
        datasets = [build_dataset(cfg.data.train)]
      File "/home/tongjiaxing/competition/DARDet-cgh/mmdet/datasets/builder.py", line 67, in build_dataset
        build_dataset(cfg['dataset'], default_args), cfg['oversample_thr'])
      File "/home/tongjiaxing/competition/DARDet-cgh/mmdet/datasets/builder.py", line 71, in build_dataset
        dataset = build_from_cfg(cfg, DATASETS, default_args)
      File "/home/tongjiaxing/anaconda3/envs/dar/lib/python3.7/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
        raise type(e)(f'{obj_cls.__name__}: {e}')
    AttributeError: Rsaicp2_new: 'COCO' object has no attribute 'get_cat_ids'
    

    I hope you can answer the questions in your busy schedule.

    opened by liliwannian 3
  • Update README.md

    Update README.md

    Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

    Motivation

    Please describe the motivation of this PR and the goal you want to achieve through this PR.

    Modification

    Please briefly describe what modification is made in this PR.

    BC-breaking (Optional)

    Does the modification introduce changes that break the back-compatibility of the downstream repos? If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

    Use cases (Optional)

    If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

    Checklist

    1. Pre-commit or other linting tools are used to fix the potential lint issues.
    2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
    3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
    4. The documentation has been modified accordingly, like docstring or example tutorials.
    opened by YingqianWang 0
  • 代码问题

    代码问题

    Thanks for your error report and we appreciate it a lot.

    Checklist

    1. I have searched related issues but cannot get the expected help.
    2. I have read the FAQ documentation but cannot get the expected help.
    3. The bug has not been fixed in the latest version.

    Describe the bug A clear and concise description of what the bug is.

    Reproduction

    1. What command or script did you run?
    A placeholder for the command.
    
    1. Did you make any modifications on the code or config? Did you understand what you have modified?
    2. What dataset did you use?

    Environment

    1. Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here.
    2. You may add addition that may be helpful for locating the problem, such as
      • How you installed PyTorch [e.g., pip, conda, source]
      • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

    Error traceback If applicable, paste the error trackback here.

    A placeholder for trackback.
    

    Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

    opened by chenchen98752 1
  • 数据集

    数据集

    Thanks for your error report and we appreciate it a lot.

    Checklist

    1. I have searched related issues but cannot get the expected help.
    2. I have read the FAQ documentation but cannot get the expected help.
    3. The bug has not been fixed in the latest version.

    Describe the bug A clear and concise description of what the bug is.

    Reproduction

    1. What command or script did you run?
    A placeholder for the command.
    
    1. Did you make any modifications on the code or config? Did you understand what you have modified?
    2. What dataset did you use?

    Environment

    1. Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here.
    2. You may add addition that may be helpful for locating the problem, such as
      • How you installed PyTorch [e.g., pip, conda, source]
      • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

    Error traceback If applicable, paste the error trackback here.

    A placeholder for trackback.
    

    Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

    opened by chenchen98752 1
  • 预训练权重在哪里下载

    预训练权重在哪里下载

    Thanks for your error report and we appreciate it a lot.

    Checklist

    1. I have searched related issues but cannot get the expected help.
    2. I have read the FAQ documentation but cannot get the expected help.
    3. The bug has not been fixed in the latest version.

    Describe the bug A clear and concise description of what the bug is.

    Reproduction

    1. What command or script did you run?
    A placeholder for the command.
    
    1. Did you make any modifications on the code or config? Did you understand what you have modified?
    2. What dataset did you use?

    Environment

    1. Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here.
    2. You may add addition that may be helpful for locating the problem, such as
      • How you installed PyTorch [e.g., pip, conda, source]
      • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

    Error traceback If applicable, paste the error trackback here.

    A placeholder for trackback.
    

    Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

    opened by chenchen98752 0
  • 更换resnet50为resnet18报错

    更换resnet50为resnet18报错

    你好,我按照您的操作,把dcnv2注释了,还出现了以下错误,该如何解决呢,期待您的回复,非常感谢! RuntimeError: Given groups=1, weight of size [256, 512, 1, 1], expected input[4, 128, 128, 128] to have 512 channels, but got 128 channels instead

    opened by WYC77 0
  • Uable to get repr for <class 'dict'>

    Uable to get repr for

    pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/henu/anaconda3/envs/dardet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py (will have no effect) /home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/torch/cuda/init.py:106: UserWarning: NVIDIA GeForce RTX 3070 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70. If you want to use the NVIDIA GeForce RTX 3070 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/ warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name)) fatal: not a git repository (or any parent up to mount point /media/henu) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). 2022-10-16 13:31:40,380 - mmdet - INFO - Environment info:

    sys.platform: linux Python: 3.7.13 (default, Mar 29 2022, 02:18:16) [GCC 7.5.0] CUDA available: True GPU 0: NVIDIA GeForce RTX 3070 CUDA_HOME: /usr/local/cuda NVCC: Build cuda_11.4.r11.4/compiler.30300941_0 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 PyTorch: 1.9.0+cu102 PyTorch compiling details: PyTorch built with:

    • GCC 7.3
    • C++ Version: 201402
    • Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
    • Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)
    • OpenMP 201511 (a.k.a. OpenMP 4.5)
    • NNPACK is enabled
    • CPU capability usage: AVX2
    • CUDA Runtime 10.2
    • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70
    • CuDNN 7.6.5
    • Magma 2.5.2
    • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=7.6.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, TorchVision: 0.10.0+cu102 OpenCV: 4.6.0 MMCV: 1.3.3 MMCV Compiler: GCC 9.4 MMCV CUDA Compiler: 11.4 MMDetection: 2.13.0+

    2022-10-16 13:31:43,812 - mmdet - INFO - Distributed training: False 2022-10-16 13:31:47,265 - mmdet - INFO - Config: model = dict( type='DARDet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs=True, extra_convs_on_inputs=False, num_outs=5, relu_before_extra_convs=True), bbox_head=dict( type='DARDetHead', num_classes=15, in_channels=256, stacked_convs=3, feat_channels=256, strides=[8, 16, 32, 64, 128], center_sampling=False, dcn_on_last_conv=False, use_atss=True, use_vfl=True, loss_cls=dict( type='VarifocalLoss', use_sigmoid=True, alpha=0.75, gamma=2.0, iou_weighted=True, loss_weight=1.0), loss_rbox=dict(type='RotatedIoULoss', loss_weight=1.5), loss_rbox_refine=dict(type='RotatedIoULoss', loss_weight=2.0)), train_cfg=dict( assigner=dict(type='ATSSAssigner', topk=9), allowed_border=-1, pos_weight=-1, debug=False), test_cfg=dict( rotate_test=True, nms_pre=2000, min_bbox_size=0, score_thr=0.05, nms=dict(type='nms', iou_threshold=0.1), max_per_img=1500)) dataset_type = 'DotaKDataset' data_root = '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='LoadAnnotations', with_bbox=True, with_mask=True, poly2mask=False), dict(type='Resize', img_scale=(1024, 1024), keep_ratio=True), dict( type='RandomFlip', direction=['horizontal', 'vertical', 'diagonal'], flip_ratio=0.5), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']) ] test_pipeline = [ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1024, 1024), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img']) ]) ] data = dict( samples_per_gpu=2, workers_per_gpu=2, train=dict( delete=True, type='ClassBalancedDataset', oversample_thr=0.06, dataset=dict( type='DotaKDataset', ann_file= '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/trainval1024/DOTA1_5_trainval1024.json', img_prefix= '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/trainval1024/images/', pipeline=[ dict(type='LoadImageFromFile'), dict( type='LoadAnnotations', with_bbox=True, with_mask=True, poly2mask=False), dict(type='Resize', img_scale=(1024, 1024), keep_ratio=True), dict( type='RandomFlip', direction=['horizontal', 'vertical', 'diagonal'], flip_ratio=0.5), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict( type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']) ])), val=dict( type='DotaKDataset', ann_file= '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/trainval1024/DOTA1_5_trainval1024.json', img_prefix= '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/trainval1024/images/', pipeline=[ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1024, 1024), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img']) ]) ]), test=dict( type='DotaKDataset', ann_file= '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/test1024/DOTA1_5_test1024.json', img_prefix= '/media/henu/新加卷1/rxh/DARDet-master/data/dota15_1024/test1024/images/', pipeline=[ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1024, 1024), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img']) ]) ])) optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) lr_config = dict( policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.001, step=[8, 11]) runner = dict(type='EpochBasedRunner', max_epochs=12) work_dir = '/media/henu/新加卷1/rxh/DARDet-master/workdir/DARDet_r50_DCN_rotate' load_from = None resume_from = None evaluation = dict( interval=3, metric='bbox', eval_dir='/media/henu/新加卷1/rxh/DARDet-master/workdir/DARDet_r50_DCN_rotate', gt_dir='/media/zf/E/Dataset/dota_1024_s2anet2/valGTtxt/') checkpoint_config = dict(interval=1) log_config = dict(interval=50, hooks=[dict(type='TextLoggerHook')]) custom_hooks = [dict(type='NumClassCheckHook')] dist_params = dict(backend='nccl') log_level = 'INFO' workflow = [('train', 1)] gpu_ids = [0] /media/henu/新加卷1/rxh/DARDet-master/mmdet/models/backbones/resnet.py:400: UserWarning: DeprecationWarning: pretrained is a deprecated, please use "init_cfg" instead warnings.warn('DeprecationWarning: pretrained is a deprecated, ' 2022-10-16 13:31:47,479 - mmcv - INFO - load model from: torchvision://resnet50 2022-10-16 13:31:47,479 - mmcv - INFO - Use load_from_torchvision loader 2022-10-16 13:31:47,558 - mmcv - WARNING - The model and loaded state dict do not match exactly unexpected key in source state_dict: fc.weight, fc.bias /home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/mmcv/cnn/utils/weight_init.py:100: UserWarning: init_cfg without layer key, if you do not define override key either, this init_cfg will do nothing 'init_cfg without layer key, if you do not define override' loading annotations into memory... Done (t=0.00s) creating index... index created! fatal: not a git repository (or any parent up to mount point /media/henu) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). loading annotations into memory... Done (t=0.00s) creating index... index created! 2022-10-16 13:31:48,151 - mmdet - INFO - Start running, host: henu@henu-Super-Server, work_dir: /media/henu/新加卷1/rxh/DARDet-master/workdir/DARDet_r50_DCN_rotate 2022-10-16 13:31:48,151 - mmdet - INFO - workflow: [('train', 1)], max: 12 epochs pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/henu/anaconda3/envs/dardet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py (will have no effect) pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/henu/anaconda3/envs/dardet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py (will have no effect) pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/henu/anaconda3/envs/dardet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py (will have no effect) pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/henu/anaconda3/envs/dardet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py (will have no effect) pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/henu/anaconda3/envs/dardet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py (will have no effect) Traceback (most recent call last): File "/home/henu/.pycharm_helpers/pydev/pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/henu/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/media/henu/新加卷1/rxh/DARDet-master/tools/train.py", line 191, in main() File "/media/henu/新加卷1/rxh/DARDet-master/tools/train.py", line 188, in main meta=meta) File "/media/henu/新加卷1/rxh/DARDet-master/mmdet/apis/train.py", line 175, in train_detector runner.run(data_loaders, cfg.workflow) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run epoch_runner(data_loaders[i], **kwargs) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train self.run_iter(data_batch, train_mode=True, **kwargs) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 30, in run_iter **kwargs) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 67, in train_step return self.module.train_step(*inputs[0], **kwargs[0]) File "/media/henu/新加卷1/rxh/DARDet-master/mmdet/models/detectors/base.py", line 237, in train_step losses = self(**data) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 95, in new_func return old_func(*args, **kwargs) File "/media/henu/新加卷1/rxh/DARDet-master/mmdet/models/detectors/base.py", line 171, in forward return self.forward_train(img, img_metas, **kwargs) File "/media/henu/新加卷1/rxh/DARDet-master/mmdet/models/detectors/dardet.py", line 143, in forward_train x = self.extract_feat(img) File "/media/henu/新加卷1/rxh/DARDet-master/mmdet/models/detectors/single_stage.py", line 37, in extract_feat x = self.backbone(img) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/media/henu/新加卷1/rxh/DARDet-master/mmdet/models/backbones/resnet.py", line 637, in forward x = self.relu(x) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in call_impl return forward_call(*input, **kwargs) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/torch/nn/modules/activation.py", line 102, in forward return F.relu(input, inplace=self.inplace) File "/home/henu/anaconda3/envs/dardet/lib/python3.7/site-packages/torch/nn/functional.py", line 1296, in relu result = torch.relu(input) RuntimeError: CUDA error: no kernel image is available for execution on the device

    After debugging, I found the variable 'data' in mmdet/models/detectors/base.py, Line237 shows that 'Uable to get repr for <class 'dict>' Specially, the variable 'img' in 'data' shows that 'Uable to get repr for <class 'torch.Tensor'> and the variable 'gt_bboxes' in 'data' shows that 'Uable to get repr for <class 'list'>

    What's the probable reason?

    opened by shenhaibb 0
Owner
null
Aerial Imagery dataset for fire detection: classification and segmentation (Unmanned Aerial Vehicle (UAV))

Aerial Imagery dataset for fire detection: classification and segmentation using Unmanned Aerial Vehicle (UAV) Title FLAME (Fire Luminosity Airborne-b

null 79 Jan 6, 2023
Official Implementation of DDOD (Disentangle your Dense Object Detector), ACM MM2021

Disentangle Your Dense Object Detector This repo contains the supported code and configuration files to reproduce object detection results of Disentan

loveSnowBest 51 Jan 7, 2023
DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Object Detection

DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Object Detection Code for our Paper DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Obje

Steven Lang 58 Dec 19, 2022
Mmrotate - OpenMMLab Rotated Object Detection Benchmark

OpenMMLab website HOT OpenMMLab platform TRY IT OUT ?? Documentation | ??️ Insta

OpenMMLab 1.2k Jan 4, 2023
A Pytorch Implementation of [Source data‐free domain adaptation of object detector through domain

A Pytorch Implementation of Source data‐free domain adaptation of object detector through domain‐specific perturbation Please follow Faster R-CNN and

null 1 Dec 25, 2021
Lane follower: Lane-detector (OpenCV) + Object-detector (YOLO5) + CAN-bus

Lane Follower This code is for the lane follower, including perception and control, as shown below. Environment Hardware Industrial Camera Intel-NUC(1

Siqi Fan 3 Jul 7, 2022
A 3D Dense mapping backend library of SLAM based on taichi-Lang designed for the aerial swarm.

TaichiSLAM This project is a 3D Dense mapping backend library of SLAM based Taichi-Lang, designed for the aerial swarm. Intro Taichi is an efficient d

XuHao 230 Dec 19, 2022
Learning Calibrated-Guidance for Object Detection in Aerial Images

Learning Calibrated-Guidance for Object Detection in Aerial Images arxiv We propose a simple yet effective Calibrated-Guidance (CG) scheme to enhance

null 51 Sep 22, 2022
Tiny Object Detection in Aerial Images.

AI-TOD AI-TOD is a dataset for tiny object detection in aerial images. [Paper] [Dataset] Description AI-TOD comes with 700,621 object instances for ei

jwwangchn 116 Dec 30, 2022
YOLTv5 rapidly detects objects in arbitrarily large aerial or satellite images that far exceed the ~600×600 pixel size typically ingested by deep learning object detection frameworks

YOLTv5 rapidly detects objects in arbitrarily large aerial or satellite images that far exceed the ~600×600 pixel size typically ingested by deep learning object detection frameworks.

Adam Van Etten 145 Jan 1, 2023
The official implementation of the CVPR 2021 paper FAPIS: a Few-shot Anchor-free Part-based Instance Segmenter

FAPIS The official implementation of the CVPR 2021 paper FAPIS: a Few-shot Anchor-free Part-based Instance Segmenter Introduction This repo is primari

Khoi Nguyen 8 Dec 11, 2022
Code for CVPR 2021 paper: Anchor-Free Person Search

Introduction This is the implementationn for Anchor-Free Person Search in CVPR2021 License This project is released under the Apache 2.0 license. Inst

null 158 Jan 4, 2023
Code for CVPR2021 paper "Learning Salient Boundary Feature for Anchor-free Temporal Action Localization"

AFSD: Learning Salient Boundary Feature for Anchor-free Temporal Action Localization This is an official implementation in PyTorch of AFSD. Our paper

Tencent YouTu Research 146 Dec 24, 2022
A high-performance anchor-free YOLO. Exceeding yolov3~v5 with ONNX, TensorRT, NCNN, and Openvino supported.

YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and industrial communities. For more details, please refer to our report on Arxiv.

null 7.7k Jan 6, 2023
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with ONNX, TensorRT, ncnn, and OpenVINO supported.

Introduction YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and ind

null 7.7k Jan 3, 2023
CenterFace(size of 7.3MB) is a practical anchor-free face detection and alignment method for edge devices.

CenterFace Introduce CenterFace(size of 7.3MB) is a practical anchor-free face detection and alignment method for edge devices. Recent Update 2019.09.

StarClouds 1.2k Dec 21, 2022
Yoloxkeypointsegment - An anchor-free version of YOLO, with a simpler design but better performance

Introduction 关键点版本:已完成 全景分割版本:已完成 实例分割版本:已完成 YOLOX is an anchor-free version of

null 23 Oct 20, 2022
Official implementation of "Dynamic Anchor Learning for Arbitrary-Oriented Object Detection" (AAAI2021).

DAL This project hosts the official implementation for our AAAI 2021 paper: Dynamic Anchor Learning for Arbitrary-Oriented Object Detection [arxiv] [c

ming71 215 Nov 28, 2022
A whale detector design for the Kaggle whale-detector challenge!

CNN (InceptionV1) + STFT based Whale Detection Algorithm So, this repository is my PyTorch solution for the Kaggle whale-detection challenge. The obje

Tarin Ziyaee 92 Sep 28, 2021