Giter Club home page Giter Club logo

atss's Introduction

Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection

License

By Shifeng Zhang, Cheng Chi, Yongqiang Yao, Zhen Lei, Stan Z. Li.

Introduction

In this work, we first point out that the essential difference between anchor-based and anchor-free detection is actually how to define positive and negative training samples. Then we propose an Adaptive Training Sample Selection (ATSS) to automatically select positive and negative samples according to statistical characteristics of object, which significantly improves the performance of anchor-based and anchor-free detectors and bridges the gap between them. Finally, we demonstrate that tiling multiple anchors per location on the image to detect objects is a thankless operation under current situations. Extensive experiments conducted on MS COCO support our aforementioned analysis and conclusions. With the newly introduced ATSS, we improve state-of-the-art detectors by a large margin to 50.7% AP without introducing any overhead. For more details, please refer to our paper.

Note: The lite version of our ATSS has been merged to the official code of FCOS as the center sampling improvement, which improves its performance by ~0.8%. The full version of our ATSS can further improve its performance.

Installation

This ATSS implementation is based on FCOS and maskrcnn-benchmark and the installation is the same as them. Please check INSTALL.md for installation instructions.

A quick demo

Once the installation is done, you can download ATSS_R_50_FPN_1x.pth from Google or Baidu to run a quick demo.

# assume that you are under the root directory of this project,
# and you have activated your virtual environment if needed.
python demo/atss_demo.py

Inference

The inference command line on coco minival split:

python tools/test_net.py \
    --config-file configs/atss/atss_R_50_FPN_1x.yaml \
    MODEL.WEIGHT ATSS_R_50_FPN_1x.pth \
    TEST.IMS_PER_BATCH 4    

Please note that:

  1. If your model's name is different, please replace ATSS_R_50_FPN_1x.pth with your own.
  2. If you enounter out-of-memory error, please try to reduce TEST.IMS_PER_BATCH to 1.
  3. If you want to evaluate a different model, please change --config-file to its config file (in configs/atss) and MODEL.WEIGHT to its weights file.

Models

For your convenience, we provide the following trained models. All models are trained with 16 images in a mini-batch and frozen batch normalization (i.e., consistent with models in FCOS and maskrcnn_benchmark).*

Model Multi-scale training Testing time / im AP (minival) AP (test-dev) Link
ATSS_R_50_FPN_1x No 44ms 39.3 39.3 Google/Baidu
ATSS_dcnv2_R_50_FPN_1x No 54ms 43.2 43.0 Google/Baidu
ATSS_R_101_FPN_2x Yes 57ms 43.5 43.6 Google/Baidu
ATSS_dcnv2_R_101_FPN_2x Yes 73ms 46.1 46.3 Google/Baidu
ATSS_X_101_32x8d_FPN_2x Yes 110ms 44.8 45.1 Google/Baidu
ATSS_dcnv2_X_101_32x8d_FPN_2x Yes 143ms 47.7 47.7 Google/Baidu
ATSS_X_101_64x4d_FPN_2x Yes 112ms 45.5 45.6 Google/Baidu
ATSS_dcnv2_X_101_64x4d_FPN_2x Yes 144ms 47.7 47.7 Google/Baidu

[1] The testing time is taken from FCOS, because our method only redefines positive and negative training samples without incurring any additional overhead.
[2] 1x and 2x mean the model is trained for 90K and 180K iterations, respectively.
[3] All results are obtained with a single model and without any test time data augmentation such as multi-scale, flipping and etc..
[4] dcnv2 denotes deformable convolutional networks v2. Note that for ResNet based models, we apply deformable convolutions from stage c3 to c5 in backbones. For ResNeXt based models, only stage c4 and c5 use deformable convolutions. All models use deformable convolutions in the last layer of detector towers.
[5] The model ATSS_dcnv2_X_101_64x4d_FPN_2x with multi-scale testing achieves 50.7% in AP on COCO test-dev. Please use TEST.BBOX_AUG.ENABLED True to enable multi-scale testing.

Training

The following command line will train ATSS_R_50_FPN_1x on 8 GPUs with Synchronous Stochastic Gradient Descent (SGD):

python -m torch.distributed.launch \
    --nproc_per_node=8 \
    --master_port=$((RANDOM + 10000)) \
    tools/train_net.py \
    --config-file configs/atss/atss_R_50_FPN_1x.yaml \
    DATALOADER.NUM_WORKERS 2 \
    OUTPUT_DIR training_dir/atss_R_50_FPN_1x

Please note that:

  1. If you want to use fewer GPUs, please change --nproc_per_node to the number of GPUs. No other settings need to be changed. The total batch size does not depends on nproc_per_node. If you want to change the total batch size, please change SOLVER.IMS_PER_BATCH in configs/atss/atss_R_50_FPN_1x.yaml.
  2. The models will be saved into OUTPUT_DIR.
  3. If you want to train ATSS with other backbones, please change --config-file.

Contributing to the project

Any pull requests or issues are welcome.

Citations

Please cite our paper in your publications if it helps your research:

@inproceedings{zhang2020bridging,
  title     =  {Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection},
  author    =  {Zhang, Shifeng and Chi, Cheng and Yao, Yongqiang and Lei, Zhen and Li, Stan Z.},
  booktitle =  {CVPR},
  year      =  {2020}
}

atss's People

Contributors

sfzhang15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atss's Issues

Have error when test

I'm training for my data use CUDA_VISIBLE_DEVICES=4,5 python -m torch.distributed.launch --nproc_per_node=2 --master_port=$((RANDOM + 10000)) tools/train_net.py --config-file configs/atss/atss_dcnv2_X_101_64x4d_FPN_2x.yaml DATALOADER.NUM_WORKERS 4 OUTPUT_DIR ./result_dcn/ and that's ok for training,but when i test it CUDA_VISIBLE_DEVICES=7 python demo/atss_demo.py --config-file ./configs/atss/atss_dcnv2_X_101_64x4d_FPN_2x.yaml --weights ./result_dcn/model_0007500.pth it's had lots of error: RuntimeError: Error(s) in loading state_dict for GeneralizedRCNN:
size mismatch for backbone.body.layer1.0.conv1.weight: copying a param with shape torch.Size([64, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 64, 1, 1]).
size mismatch for backbone.body.layer1.0.bn1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.bn1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.bn1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.bn1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 4, 3, 3]).
size mismatch for backbone.body.layer1.0.bn2.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.bn2.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.bn2.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.bn2.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.0.conv3.weight: copying a param with shape torch.Size([256, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for backbone.body.layer1.1.conv1.weight: copying a param with shape torch.Size([64, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for backbone.body.layer1.1.bn1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.bn1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.bn1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.bn1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 4, 3, 3]).
size mismatch for backbone.body.layer1.1.bn2.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.bn2.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.bn2.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.bn2.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.1.conv3.weight: copying a param with shape torch.Size([256, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for backbone.body.layer1.2.conv1.weight: copying a param with shape torch.Size([64, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for backbone.body.layer1.2.bn1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.bn1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.bn1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.bn1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 4, 3, 3]).
size mismatch for backbone.body.layer1.2.bn2.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.bn2.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.bn2.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.bn2.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for backbone.body.layer1.2.conv3.weight: copying a param with shape torch.Size([256, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for backbone.body.layer2.0.conv1.weight: copying a param with shape torch.Size([128, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 256, 1, 1]).
size mismatch for backbone.body.layer2.0.bn1.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.bn1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.bn1.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.bn1.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 8, 3, 3]).
size mismatch for backbone.body.layer2.0.bn2.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.bn2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.bn2.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.bn2.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.0.conv3.weight: copying a param with shape torch.Size([512, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer2.1.conv1.weight: copying a param with shape torch.Size([128, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer2.1.bn1.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.bn1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.bn1.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.bn1.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 8, 3, 3]).
size mismatch for backbone.body.layer2.1.bn2.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.bn2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.bn2.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.bn2.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.1.conv3.weight: copying a param with shape torch.Size([512, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer2.2.conv1.weight: copying a param with shape torch.Size([128, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer2.2.bn1.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.bn1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.bn1.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.bn1.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 8, 3, 3]).
size mismatch for backbone.body.layer2.2.bn2.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.bn2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.bn2.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.bn2.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.2.conv3.weight: copying a param with shape torch.Size([512, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer2.3.conv1.weight: copying a param with shape torch.Size([128, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer2.3.bn1.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.bn1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.bn1.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.bn1.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 8, 3, 3]).
size mismatch for backbone.body.layer2.3.bn2.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.bn2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.bn2.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.bn2.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for backbone.body.layer2.3.conv3.weight: copying a param with shape torch.Size([512, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for backbone.body.layer3.0.conv1.weight: copying a param with shape torch.Size([256, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 512, 1, 1]).
size mismatch for backbone.body.layer3.0.bn1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn2.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn2.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.bn2.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.0.conv3.weight: copying a param with shape torch.Size([1024, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.1.conv1.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.1.bn1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn2.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn2.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.bn2.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.1.conv3.weight: copying a param with shape torch.Size([1024, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.2.conv1.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.2.bn1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn2.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn2.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.bn2.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.2.conv3.weight: copying a param with shape torch.Size([1024, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.3.conv1.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.3.bn1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn2.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn2.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.bn2.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.3.conv3.weight: copying a param with shape torch.Size([1024, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.4.conv1.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.4.bn1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn2.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn2.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.bn2.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.4.conv3.weight: copying a param with shape torch.Size([1024, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.5.conv1.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer3.5.bn1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn2.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn2.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.bn2.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for backbone.body.layer3.5.conv3.weight: copying a param with shape torch.Size([1024, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).
size mismatch for backbone.body.layer4.0.conv1.weight: copying a param with shape torch.Size([512, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([2048, 1024, 1, 1]).
size mismatch for backbone.body.layer4.0.bn1.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn1.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn1.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn2.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn2.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn2.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.bn2.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.0.conv3.weight: copying a param with shape torch.Size([2048, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([2048, 2048, 1, 1]).
size mismatch for backbone.body.layer4.1.conv1.weight: copying a param with shape torch.Size([512, 2048, 1, 1]) from checkpoint, the shape in current model is torch.Size([2048, 2048, 1, 1]).
size mismatch for backbone.body.layer4.1.bn1.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn1.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn1.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn2.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn2.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn2.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.bn2.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.1.conv3.weight: copying a param with shape torch.Size([2048, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([2048, 2048, 1, 1]).
size mismatch for backbone.body.layer4.2.conv1.weight: copying a param with shape torch.Size([512, 2048, 1, 1]) from checkpoint, the shape in current model is torch.Size([2048, 2048, 1, 1]).
size mismatch for backbone.body.layer4.2.bn1.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn1.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn1.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn2.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn2.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn2.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.bn2.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([2048]).
size mismatch for backbone.body.layer4.2.conv3.weight: copying a param with shape torch.Size([2048, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([2048, 2048, 1, 1]).

other, use atss_R_50_FPN_1x.yaml train and test it's Ok ,but atss_dcnv2_X_101_64x4d_FPN_2x.yaml has error

Is ATSS suitable for detecting large aspect ratio objects?

According to the paper, ATSS is insensitive to aspect ratios and scales. Only one anchor per location can get a good result. But this situation is for COCO dataset. Most objects in COCO do not have a large aspect ratio. For industrial inspections, some defects may have really large aspect ratios (e.g. 1: 10). So is ATSS suitable for this situation? Anyway, the similar the anchor and the gt_box are, the easier it is for the network to learn.

SSD centerness

In the SSD framework, Can I use centerness? how use the it?

Appearing "nan" during training

when just using atss_r50 , but the loss_centrness is keep nan

2020-03-16 11:31:03,886 atss_core.trainer INFO: eta: 7:16:51 iter: 35320 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7951) loss_reg: nan (nan) time: 0.4746 (0.4794) dat[0/1224]
7 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:31:13,489 atss_core.trainer INFO: eta: 7:16:41 iter: 35340 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7951) loss_reg: nan (nan) time: 0.4779 (0.4794) data: 0.012
6 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:31:23,103 atss_core.trainer INFO: eta: 7:16:32 iter: 35360 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7952) loss_reg: nan (nan) time: 0.4784 (0.4794) data: 0.012
9 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:31:32,660 atss_core.trainer INFO: eta: 7:16:22 iter: 35380 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7952) loss_reg: nan (nan) time: 0.4760 (0.4794) data: 0.013
3 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:31:42,264 atss_core.trainer INFO: eta: 7:16:13 iter: 35400 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7952) loss_reg: nan (nan) time: 0.4782 (0.4794) data: 0.012
5 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:31:51,898 atss_core.trainer INFO: eta: 7:16:03 iter: 35420 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7952) loss_reg: nan (nan) time: 0.4796 (0.4794) data: 0.012
6 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:01,503 atss_core.trainer INFO: eta: 7:15:53 iter: 35440 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7953) loss_reg: nan (nan) time: 0.4759 (0.4794) data: 0.013
2 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:10,856 atss_core.trainer INFO: eta: 7:15:44 iter: 35460 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7953) loss_reg: nan (nan) time: 0.4740 (0.4794) data: 0.012
9 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:20,435 atss_core.trainer INFO: eta: 7:15:34 iter: 35480 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7953) loss_reg: nan (nan) time: 0.4752 (0.4794) data: 0.013
8 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:30,141 atss_core.trainer INFO: eta: 7:15:25 iter: 35500 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7953) loss_reg: nan (nan) time: 0.4839 (0.4794) data: 0.013
4 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:39,787 atss_core.trainer INFO: eta: 7:15:15 iter: 35520 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7953) loss_reg: nan (nan) time: 0.4814 (0.4794) data: 0.012
4 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:49,445 atss_core.trainer INFO: eta: 7:15:06 iter: 35540 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7954) loss_reg: nan (nan) time: 0.4775 (0.4794) data: 0.012
8 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:32:59,029 atss_core.trainer INFO: eta: 7:14:56 iter: 35560 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7954) loss_reg: nan (nan) time: 0.4765 (0.4794) data: 0.013
3 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:33:08,577 atss_core.trainer INFO: eta: 7:14:46 iter: 35580 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7954) loss_reg: nan (nan) time: 0.4760 (0.4794) data: 0.013
0 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:33:18,283 atss_core.trainer INFO: eta: 7:14:37 iter: 35600 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7954) loss_reg: nan (nan) time: 0.4818 (0.4794) data: 0.012
3 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:33:27,834 atss_core.trainer INFO: eta: 7:14:27 iter: 35620 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7954) loss_reg: nan (nan) time: 0.4761 (0.4794) data: 0.012
7 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:33:37,441 atss_core.trainer INFO: eta: 7:14:18 iter: 35640 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7955) loss_reg: nan (nan) time: 0.4758 (0.4794) data: 0.012
5 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:33:47,026 atss_core.trainer INFO: eta: 7:14:08 iter: 35660 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7955) loss_reg: nan (nan) time: 0.4770 (0.4794) data: 0.013
8 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:33:56,665 atss_core.trainer INFO: eta: 7:13:59 iter: 35680 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7955) loss_reg: nan (nan) time: 0.4823 (0.4794) data: 0.013
1 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:34:06,223 atss_core.trainer INFO: eta: 7:13:49 iter: 35700 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7955) loss_reg: nan (nan) time: 0.4770 (0.4794) data: 0.013
6 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:34:15,821 atss_core.trainer INFO: eta: 7:13:39 iter: 35720 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7956) loss_reg: nan (nan) time: 0.4782 (0.4794) data: 0.012
8 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:34:25,217 atss_core.trainer INFO: eta: 7:13:30 iter: 35740 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7956) loss_reg: nan (nan) time: 0.4768 (0.4794) data: 0.013
6 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:34:34,755 atss_core.trainer INFO: eta: 7:13:20 iter: 35760 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7956) loss_reg: nan (nan) time: 0.4747 (0.4794) data: 0.012
6 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:34:44,318 atss_core.trainer INFO: eta: 7:13:10 iter: 35780 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7956) loss_reg: nan (nan) time: 0.4766 (0.4794) data: 0.013
5 (0.0135) lr: 0.010000 max mem: 5423
2020-03-16 11:34:53,960 atss_core.trainer INFO: eta: 7:13:01 iter: 35800 loss: nan (nan) loss_centerness: nan (nan) loss_cls: 21.8341 (21.7956) loss_reg: nan (nan) time: 0.4813 (0.4794) data: 0.013
9 (0.0135) lr: 0.010000 max mem: 5423
Traceback (most recent call last):
File "/home/wxp/anaconda3/envs/atss/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/wxp/anaconda3/envs/atss/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/wxp/anaconda3/envs/atss/lib/python3.7/site-packages/torch/distributed/launch.py", line 235, in
main()
File "/home/wxp/anaconda3/envs/atss/lib/python3.7/site-packages/torch/distributed/launch.py", line 231, in main
cmd=process.args)
subprocess.CalledProcessError: Command '['/home/wxp/anaconda3/envs/atss/bin/python', '-u', 'tools/train_net.py', '--local_rank=0', '--config-file', 'configs/atss/atss_R_50_FPN_1x.yaml', 'DATALOADER.NUM_WO
RKERS', '2', 'OUTPUT_DIR', 'training_dir/atss_R_50_FPN_1x']' died with <Signals.SIGKILL: 9>.

Have you tried ATSS on the original RetinaNet?

I noticed that all your experiments follow this order: original detector --> Imprs --> ATSS. Have you tried this order: original detector --> ATSS ? I just want to know which trick in Imprs is unnecessary due to the existence of ATSS. Because from my opinion, ATSS helps to balance the numbers of the matched anchors for each gt box and improved the match quality. So maybe one or more tricks in Imprs is useless or have less effect, e.g. In GT Box ? Because they are doing the same things. Any insights?

No module named 'atss_core"

Good morning,

When I try to run the demo, I get the following error:

Traceback (most recent call last):
  File "demo/atss_demo.py", line 5, in <module>
    from atss_core.config import cfg
ModuleNotFoundError: No module named 'atss_core'```

Does anyone know why?

hello,can this code run on windows?

I am work on windows,when run your code, see your install list ,it needs to install gcc? but windows can't, and when install other modules, there are lots of problems... so how to run it on windows?

@thisisi3

Hello, what is the final model used by ATSS?

anchor center is inside gt?

for ng in range(num_gt): l = anchors_cx_per_im[candidate_idxs[:, ng]] - bboxes_per_im[ng, 0] t = anchors_cy_per_im[candidate_idxs[:, ng]] - bboxes_per_im[ng, 1] r = bboxes_per_im[ng, 2] - anchors_cx_per_im[candidate_idxs[:, ng]] b = bboxes_per_im[ng, 3] - anchors_cy_per_im[candidate_idxs[:, ng]] is_in_gts.append(torch.stack([l, t, r, b], dim=1).min(dim=1)[0] > 0.01)
l,t,r,b is regression target, so if we want to make sure this anchor center is in gt, we can make sure l,b is a negative number, and r,b is positive. so why this operation torch.stack([l, t, r, b], dim=1).min(dim=1)[0] > 0.01 made min(l,t,r,b) is all positive number. That would made anchor center is in the left bottom of gt box.
Thanks a lot.

ImportError: cannot import name '_C' from 'atss_core'

/opt/Anaconda3/envs/ATSS_cuda10/bin/python3.7 /home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/tools/test_net.py
Traceback (most recent call last):
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/tools/test_net.py", line 11, in
from atss_core.data import make_data_loader
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/data/init.py", line 2, in
from .build import make_data_loader
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/data/build.py", line 10, in
from . import datasets as D
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/data/datasets/init.py", line 2, in
from .coco import COCODataset
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/data/datasets/coco.py", line 6, in
from atss_core.structures.segmentation_mask import SegmentationMask
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/structures/segmentation_mask.py", line 5, in
from atss_core.layers.misc import interpolate
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/layers/init.py", line 10, in
from .nms import nms, ml_nms
File "/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/layers/nms.py", line 3, in
from atss_core import _C
ImportError: cannot import name '_C' from 'atss_core' (/home/data/zhanghuanqing/ATSS/ATSS_HRRSD_origin/ATSS-master/atss_core/init.py)

How many epochs did you run?

max_iter = 180k
coco_trainval = 35k
I think it's about 5 epochs if you calculate it with epoch.
If my dataset is 60k, is it right to run 300k?

AttributeError: 'NoneType' object has no attribute 'get'

A problem occurred while I run the test_net!

Traceback (most recent call last):
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/tools/test_net.py", line 100, in
main()
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/tools/test_net.py", line 64, in main
model = build_detection_model(cfg)
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/detector/detectors.py", line 10, in build_detection_model
return meta_arch(cfg)
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/detector/generalized_rcnn.py", line 31, in init
self.roi_heads = build_roi_heads(cfg, self.backbone.out_channels)
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/roi_heads/roi_heads.py", line 66, in build_roi_heads
roi_heads.append(("box", build_roi_box_head(cfg, in_channels)))
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/roi_heads/box_head/box_head.py", line 71, in build_roi_box_head
return ROIBoxHead(cfg, in_channels)
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/roi_heads/box_head/box_head.py", line 18, in init
self.feature_extractor = make_roi_box_feature_extractor(cfg, in_channels)
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/roi_heads/box_head/roi_box_feature_extractors.py", line 151, in make_roi_box_feature_extractor
return func(cfg, in_channels)
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/roi_heads/box_head/roi_box_feature_extractors.py", line 36, in init
dilation=config.MODEL.RESNETS.RES5_DILATION
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/backbone/resnet.py", line 194, in init
dcn_config=dcn_config
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/backbone/resnet.py", line 231, in _make_stage
dcn_config=dcn_config
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/backbone/resnet.py", line 390, in init
dcn_config=dcn_config
File "/home/lab30202/sdb/liuqiang/2019-12-6-ATSS/ATSS-master/atss_core/modeling/backbone/resnet.py", line 286, in init
with_dcn = dcn_config.get("stage_with_dcn", False)
AttributeError: 'NoneType' object has no attribute 'get'

RetinaNet : Anchor box offsets and GIoU loss

Hey Shifeng Zhang,
Thank you for the extremely interesting analysis you and the co-authors put forth in the paper. I, however, have a question concerning the implementation of FCOS modules within RetinaNet, the GIoU loss module to be more precise.
As you must be aware, the smooth_l1 loss calculated during RetinaNet training is on anchor box offsets, i.e tx, ty, tw and th and not bounding box offsets x1, y1, x2 and y2. To this end, my questions are as follows :

  • While training RetinaNet with GIoU loss did you skip the bounding transformation (x1, y1, x2, y2 to tx, ty, tw, th) and compute the GIoU loss on the bounding box values (ground-truth and prediction) rather than the offsets? Or was the training effectuated using a different methodology?
  • While incorporating the GIoU loss, did you modify the network architecture (Eg: applying an exp() transform on regression outputs) in any way to accommodate for this change?
    Thank you for your response :)

error in table6 in ATSS paper

in the first column of table 6, there are 2( 4:1 ) and 2(2:1), but shouldn't it be (1:4),(1:2),(1:1),(2:1),(4:1)?

The training process is unstable.

When I train dcnX101 or X101. The training process is breaking , while report no bugs, and the memory is still occupied, which cause the X101 model is 0.4 lower than you paper mentioned.

and mackrcnn benchmark seems have this issue too.
so, how do you fix that problem?

about multi scale training

first of all ,thanks for your works, i want to know multi scale training and multi scale test. but i can not find the code in your demo

What is the difference between 'In GT Box' and 'Spatial constraint'

Thank you for sharing your great works!

I'm wondering what is the difference between the In GT Box on the Table 1 and the Spatial constraint on the Figure 1.
When I first read your paper, I understood that the In GT Box and Spatial constraint is the same based on the description below.

limiting positive samples in the ground-truth box [56]

However, on the table 2, you compared the score of the Intersection over Union and Spatial and Scale Constraint in spite of the score of the IoU includes the improvement from the In GT Box.

It makes me confusing whether In GT Box and Spatial Constraint are different operation.

Thank you in advances for your help!

Add ATSS to RPN

Hi,
Really good work!
It seems RPN here also supports ATSS sampler, I am wondering if you've tested it in any model (e.g. FasterRCNN) on any dataset? If so do you mind sharing the configuration and the benchmark, thanks.

ImportError: cannot import name '_C'

Traceback (most recent call last):
File "tools/train_net.py", line 15, in
from atss_core.data import make_data_loader
File "/atss/ATSS/tools/atss_core/data/init.py", line 2, in
from .build import make_data_loader
File "/atss/ATSS/tools/atss_core/data/build.py", line 10, in
from . import datasets as D
File "/atss/ATSS/tools/atss_core/data/datasets/init.py", line 2, in
from .coco import COCODataset
File "/atss/ATSS/tools/atss_core/data/datasets/coco.py", line 6, in
from atss_core.structures.segmentation_mask import SegmentationMask
File "/atss/ATSS/tools/atss_core/structures/segmentation_mask.py", line 5, in
from atss_core.layers.misc import interpolate
File "/atss/ATSS/tools/atss_core/layers/init.py", line 10, in
from .nms import nms, ml_nms
File "/atss/ATSS/tools/atss_core/layers/nms.py", line 3, in
from atss_core import _C
ImportError: cannot import name '_C'

ImportError: No module named 'torchvision'

Hello,when I run atss_core.py on SPYDER,there is an error which tell me No module named 'torchvision'.But I have downloaded torch.

File "D:\ATSS\demo\atss_demo.py", line 6, in
from predictor import COCODemo

File "D:\ATSS\demo\predictor.py", line 6, in
from atss_core.modeling.detector import build_detection_model

File "D:\ATSS\demo\atss_core\modeling\detector_init_.py", line 2, in
from .detectors import build_detection_model

File "D:\ATSS\demo\atss_core\modeling\detector\detectors.py", line 2, in
from .generalized_rcnn import GeneralizedRCNN

File "D:\ATSS\demo\atss_core\modeling\detector\generalized_rcnn.py", line 11, in
from ..backbone import build_backbone

File "D:\ATSS\demo\atss_core\modeling\backbone_init_.py", line 2, in
from .backbone import build_backbone

File "D:\ATSS\demo\atss_core\modeling\backbone\backbone.py", line 7, in
from atss_core.modeling.make_layers import conv_with_kaiming_uniform

File "D:\ATSS\demo\atss_core\modeling\make_layers.py", line 10, in
from atss_core.layers import Conv2d

File "D:\ATSS\demo\atss_core\layers_init_.py", line 13, in
from .nms import nms, ml_nms

File "D:\ATSS\demo\atss_core\layers\nms.py", line 2, in
from ._utils import _C

File "D:\ATSS\demo\atss_core\layers_utils.py", line 39, in
_C = _load_C_extensions()

File "D:\ATSS\demo\atss_core\layers_utils.py", line 35, in _load_C_extensions
extra_include_paths=extra_include_paths,

File "F:\anaconda\lib\site-packages\torch\utils\cpp_extension.py", line 898, in load
is_python_module)

File "F:\anaconda\lib\site-packages\torch\utils\cpp_extension.py", line 1097, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)

File "F:\anaconda\lib\site-packages\torch\utils\cpp_extension.py", line 1418, in _import_module_from_library
file, path, description = imp.find_module(module_name, [path])

File "F:\anaconda\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)

ImportError: No module named 'torchvision'

IOU

你好,我想问一下在使用ATSS计算阈值时,有试过用GIoU或者DIoU代替IoU吗?

train with custom datasets

When I trained with my own dataset, an error occurred.
I refer to question 14, and use a VOC format dataset.
After training several epochs, the training is stuck and no error message is reported.

2020-03-03 09:01:13,561 atss_core.data.build WARNING: When using more than one image per GPU you may encounter an out-of-memory (OOM) error if your GPU does not have sufficient memory. If this happens, you can reduce SOLVER.IMS_PER_BATCH (for training) or TEST.IMS_PER_BATCH (for inference). For training, you must also adjust the learning rate and schedule length according to the linear scaling rule. See for example: https://github.com/facebookresearch/Detectron/blob/master/configs/getting_started/tutorial_1gpu_e2e_faster_rcnn_R-50-FPN.yaml#L14
2020-03-03 09:01:14,200 atss_core.trainer INFO: Start training
2020-03-03 09:01:41,085 atss_core.trainer INFO: eta: 11:11:34 iter: 20 loss: 2.3583 (2.4249) loss_centerness: 0.6581 (0.6735) loss_cls: 0.8432 (0.8624) loss_reg: 0.8724 (0.8890) time: 1.3581 (1.3440) data: 0.2522 (0.3124) lr: 0.000167 max mem: 4039
2020-03-03 09:02:08,343 atss_core.trainer INFO: eta: 11:15:50 iter: 40 loss: 2.1446 (2.2998) loss_centerness: 0.6432 (0.6587) loss_cls: 0.6304 (0.7604) loss_reg: 0.8565 (0.8808) time: 1.3038 (1.3535) data: 0.2461 (0.2953) lr: 0.000167 max mem: 4039
2020-03-03 09:02:37,059 atss_core.trainer INFO: eta: 11:29:04 iter: 60 loss: 2.1173 (2.2426) loss_centerness: 0.6291 (0.6498) loss_cls: 0.6318 (0.7219) loss_reg: 0.8421 (0.8708) time: 1.4707 (1.3809) data: 0.3749 (0.3216) lr: 0.000167 max mem: 4150
2020-03-03 09:03:05,780 atss_core.trainer INFO: eta: 11:35:29 iter: 80 loss: 2.0577 (2.1967) loss_centerness: 0.6350 (0.6464) loss_cls: 0.5637 (0.6818) loss_reg: 0.8557 (0.8684) time: 1.4177 (1.3947) data: 0.3985 (0.3353) lr: 0.000167 max mem: 4150
2020-03-03 09:03:34,258 atss_core.trainer INFO: eta: 11:37:56 iter: 100 loss: 2.0242 (2.1684) loss_centerness: 0.6328 (0.6441) loss_cls: 0.5646 (0.6626) loss_reg: 0.8252 (0.8618) time: 1.4187 (1.4005) data: 0.2573 (0.3346) lr: 0.000167 max mem: 4153
2020-03-03 09:04:01,555 atss_core.trainer INFO: eta: 11:34:30 iter: 120 loss: 2.0670 (2.1527) loss_centerness: 0.6368 (0.6438) loss_cls: 0.5709 (0.6459) loss_reg: 0.8609 (0.8631) time: 1.3416 (1.3946) data: 0.2366 (0.3213) lr: 0.000167 max mem: 4153
2020-03-03 09:04:28,856 atss_core.trainer INFO: eta: 11:31:56 iter: 140 loss: 1.9155 (2.1227) loss_centerness: 0.6255 (0.6420) loss_cls: 0.5054 (0.6274) loss_reg: 0.7737 (0.8533) time: 1.4071 (1.3904) data: 0.2924 (0.3174) lr: 0.000167 max mem: 4153
2020-03-03 09:04:57,257 atss_core.trainer INFO: eta: 11:33:19 iter: 160 loss: 1.9624 (2.1043) loss_centerness: 0.6367 (0.6418) loss_cls: 0.5202 (0.6145) loss_reg: 0.8103 (0.8480) time: 1.4475 (1.3941) data: 0.2737 (0.3206) lr: 0.000167 max mem: 4153

ImportError: /root/atss/ATSS/atss_core/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __cudaPopCallConfiguration

(base) root@a096b2d397ad:~/atss/ATSS# python demo/atss_demo.py
Traceback (most recent call last):
File "demo/atss_demo.py", line 6, in
from predictor import COCODemo
File "/root/atss/ATSS/demo/predictor.py", line 6, in
from atss_core.modeling.detector import build_detection_model
File "/root/atss/ATSS/atss_core/modeling/detector/init.py", line 2, in
from .detectors import build_detection_model
File "/root/atss/ATSS/atss_core/modeling/detector/detectors.py", line 2, in
from .generalized_rcnn import GeneralizedRCNN
File "/root/atss/ATSS/atss_core/modeling/detector/generalized_rcnn.py", line 11, in
from ..backbone import build_backbone
File "/root/atss/ATSS/atss_core/modeling/backbone/init.py", line 2, in
from .backbone import build_backbone
File "/root/atss/ATSS/atss_core/modeling/backbone/backbone.py", line 7, in
from atss_core.modeling.make_layers import conv_with_kaiming_uniform
File "/root/atss/ATSS/atss_core/modeling/make_layers.py", line 10, in
from atss_core.layers import Conv2d
File "/root/atss/ATSS/atss_core/layers/init.py", line 10, in
from .nms import nms, ml_nms
File "/root/atss/ATSS/atss_core/layers/nms.py", line 3, in
from atss_core import _C
ImportError: /root/atss/ATSS/atss_core/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __cudaPopCallConfiguration

use 'test_net.py' evaluate on 'coco_2017_test_dev'

Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
Maximum f-measures for classes:
[-0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
Score thresholds for classes (used in demos for visualization purposes):
[-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]
2020-06-11 19:17:02,969 atss_core.inference INFO: OrderedDict([('bbox', OrderedDict([('AP', -1.0), ('AP50', -1.0), ('AP75', -1.0), ('APs', -1.0), ('APm', -1.0), ('APl', -1.0)]))])

when will release the code based on detectron2?

In previous issues, you said that the code reimplemented on detectron2 will be released soon. When will you release it? I got some problems, particularly, anchor generation and its change during the whole process, when implementing it on detectron2. Therefore, I hope to see your implementation and find my errors. @sfzhang15

I encouter an error when runing demo

I have encounter an error when running demo.
File "/git/ATSS/atss_core/modeling/rpn/atss/inference.py", line 93, in forward boxlists = self.select_over_all_levels(boxlists) File "/git/ATSS/atss_core/modeling/rpn/atss/inference.py", line 106, in select_over_all_levels result = boxlist_ml_nms(boxlists[i], self.nms_thresh) File "/git/ATSS/atss_core/structures/boxlist_ops.py", line 55, in boxlist_ml_nms keep = _box_ml_nms(boxes, scores, labels.float(), nms_thresh) RuntimeError: Not compiled with GPU support (ml_nms at atss_core/csrc/ml_nms.h:23)

Cound you help me fix this error?

Centerness

Why your code have centerness? Did you trained it without centerness?

2020-03-27 00:56:32,241 atss_core.trainer INFO: eta: 4:39:09 iter: 71400 loss_centerness: 0.6109 (0.6188) data: 0.0220 (0.0534) loss_reg: 0.3875 (0.4938) loss_cls: 0.2731 (0.3768) loss: 1.2675 (1.4895) time: 1.8760 (0.9005) lr: 0.001000 max mem: 7624
2020-03-27 00:57:46,855 atss_core.trainer INFO: eta: 4:39:06 iter: 71420 loss_centerness: 0.6152 (0.6188) data: 0.0260 (0.0534) loss_reg: 0.4004 (0.4938) loss_cls: 0.2567 (0.3768) loss: 1.2759 (1.4894) time: 2.3018 (0.9013) lr: 0.001000 max mem: 7624
2020-03-27 00:58:51,938 atss_core.trainer INFO: eta: 4:39:00 iter: 71440 loss_centerness: 0.6110 (0.6188) data: 0.0206 (0.0538) loss_reg: 0.3758 (0.4938) loss_cls: 0.2578 (0.3768) loss: 1.2388 (1.4894) time: 1.3783 (0.9020) lr: 0.001000 max mem: 7624
2020-03-27 00:59:42,940 atss_core.trainer INFO: eta: 4:38:51 iter: 71460 loss_centerness: 0.6086 (0.6188) data: 0.0253 (0.0538) loss_reg: 0.3679 (0.4937) loss_cls: 0.2551 (0.3767) loss: 1.2425 (1.4893) time: 0.4738 (0.9024) lr: 0.001000 max mem: 7624
2020-03-27 01:00:43,930 atss_core.trainer INFO: eta: 4:38:44 iter: 71480 loss_centerness: 0.6093 (0.6188) data: 0.0229 (0.0538) loss_reg: 0.3840 (0.4937) loss_cls: 0.2673 (0.3767) loss: 1.2500 (1.4892) time: 1.5824 (0.9030) lr: 0.001000 max mem: 7624
2020-03-27 01:01:42,928 atss_core.trainer INFO: eta: 4:38:36 iter: 71500 loss_centerness: 0.6116 (0.6188) data: 0.0244 (0.0538) loss_reg: 0.3801 (0.4937) loss_cls: 0.2634 (0.3767) loss: 1.2517 (1.4892) time: 1.5503 (0.9036) lr: 0.001000 max mem: 7624
2020-03-27 01:02:47,217 atss_core.trainer INFO: eta: 4:38:30 iter: 71520 loss_centerness: 0.6121 (0.6188) data: 0.0210 (0.0538) loss_reg: 0.3795 (0.4936) loss_cls: 0.2723 (0.3766) loss: 1.2715 (1.4891) time: 2.8492 (0.9043) lr: 0.001000 max mem: 7624
2020-03-27 01:04:00,049 atss_core.trainer INFO: eta: 4:38:26 iter: 71540 loss_centerness: 0.6098 (0.6188) data: 0.0250 (0.0538) loss_reg: 0.3747 (0.4936) loss_cls: 0.2660 (0.3766) loss: 1.2543 (1.4890) time: 1.1921 (0.9050) lr: 0.001000 max mem: 7624
2020-03-27 01:04:57,189 atss_core.trainer INFO: eta: 4:38:18 iter: 71560 loss_centerness: 0.6097 (0.6188) data: 0.0233 (0.0538) loss_reg: 0.4028 (0.4936) loss_cls: 0.2744 (0.3766) loss: 1.2844 (1.4890) time: 1.2006 (0.9056) lr: 0.001000 max mem: 7624
2020-03-27 01:06:06,845 atss_core.trainer INFO: eta: 4:38:13 iter: 71580 loss_centerness: 0.6108 (0.6188) data: 0.0220 (0.0539) loss_reg: 0.3787 (0.4935) loss_cls: 0.2680 (0.3765) loss: 1.2679 (1.4889) time: 0.4773 (0.9063) lr: 0.001000 max mem: 7624
2020-03-27 01:07:30,623 atss_core.trainer INFO: eta: 4:38:12 iter: 71600 loss_centerness: 0.6117 (0.6188) data: 0.0246 (0.0539) loss_reg: 0.3828 (0.4935) loss_cls: 0.2620 (0.3765) loss: 1.2610 (1.4888) time: 3.6777 (0.9072) lr: 0.001000 max mem: 7624

inference time

hi, I have run the ATSS_dcnv2_R_50_FPN_1x model with atss_demo.py and min-image-size=1080/800 settings, average inference time is 400/360ms for 100 images. I used M40 gpu and without saving result images.

it is far away with your inference time 54ms, what is your test settings?

_c error

running build
running build_py
running egg_info
writing atss.egg-info/PKG-INFO
writing dependency_links to atss.egg-info/dependency_links.txt
writing requirements to atss.egg-info/requires.txt
writing top-level names to atss.egg-info/top_level.txt
reading manifest file 'atss.egg-info/SOURCES.txt'
writing manifest file 'atss.egg-info/SOURCES.txt'
running build_ext
running develop
running build_ext
copying build/lib.linux-x86_64-3.7/atss_core/_C.cpython-37m-x86_64-linux-gnu.so -> atss_core
Creating /home/hansol/anaconda3/envs/ATSS/lib/python3.7/site-packages/atss.egg-link (link to .)
atss 0.1 is already the active version in easy-install.pth

Traceback (most recent call last):
File "tools/test_net.py", line 11, in
from atss_core.data import make_data_loader
File "/home/hansol/PycharmProjects/ATSS/atss_core/data/init.py", line 2, in
from .build import make_data_loader
File "/home/hansol/PycharmProjects/ATSS/atss_core/data/build.py", line 10, in
from . import datasets as D
File "/home/hansol/PycharmProjects/ATSS/atss_core/data/datasets/init.py", line 2, in
from .coco import COCODataset
File "/home/hansol/PycharmProjects/ATSS/atss_core/data/datasets/coco.py", line 6, in
from atss_core.structures.segmentation_mask import SegmentationMask
File "/home/hansol/PycharmProjects/ATSS/atss_core/structures/segmentation_mask.py", line 5, in
from atss_core.layers.misc import interpolate
File "/home/hansol/PycharmProjects/ATSS/atss_core/layers/init.py", line 10, in
from .nms import nms, ml_nms
File "/home/hansol/PycharmProjects/ATSS/atss_core/layers/nms.py", line 3, in
from atss_core import _C
ImportError: /home/hansol/PycharmProjects/ATSS/atss_core/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __cudaPopCallConfiguration

I built but there is a _C error.

class num

在ATSSHead中,num_classes = cfg.MODEL.ATSS_NUM_CLASSES - 1,这个是不是意味着你只计算了前景类别的得分?而且focal loss计算class loss,哪里似乎也没有考虑到背景,会不会存在问题?

the P and N

I dnt ubderstand. the P and N is total the same as the original anchors of all levels????
the number is the same as the original???

shpe mismatch in loss.py

Traceback (most recent call last): File "tools/train_net.py", line 192, in <module> main() File "tools/train_net.py", line 185, in main model = train(cfg, args.local_rank, args.distributed) File "tools/train_net.py", line 79, in train arguments, File "/home/wangqian/ATSS/atss_core/engine/trainer.py", line 69, in do_train loss_dict = model(images, targets) File "/home/wangqian/anaconda3/envs/torch1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/home/wangqian/anaconda3/envs/torch1.3/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 442, in forward output = self.module(*inputs[0], **kwargs[0]) File "/home/wangqian/anaconda3/envs/torch1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/home/wangqian/ATSS/atss_core/modeling/detector/generalized_rcnn.py", line 50, in forward proposals, proposal_losses = self.rpn(images, features, targets) File "/home/wangqian/anaconda3/envs/torch1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/home/wangqian/ATSS/atss_core/modeling/rpn/atss/atss.py", line 210, in forward return self._forward_train(box_cls, box_regression, centerness, targets, anchors) File "/home/wangqian/ATSS/atss_core/modeling/rpn/atss/atss.py", line 216, in _forward_train box_cls, box_regression, centerness, targets, anchors File "/home/wangqian/ATSS/atss_core/modeling/rpn/atss/loss.py", line 239, in __call__ labels, reg_targets = self.prepare_targets(targets, anchors) File "/home/wangqian/ATSS/atss_core/modeling/rpn/atss/loss.py", line 178, in prepare_targets ious[candidate_idxs[is_pos[:, ng] == 1, ng], ng] RuntimeError: shape mismatch: value tensor of shape [6] cannot be broadcast to indexing result of shape [5]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.