GithubHelp home page GithubHelp logo

centernet2's People

Contributors

alexander-kirillov avatar apivovarov avatar bowenc0221 avatar bryant1410 avatar chenbohua3 avatar chengyangfu avatar endernewton avatar jonmorton avatar jss367 avatar kondela avatar lyttonhao avatar marcszafraniec avatar maxfrei750 avatar mrparosk avatar obendidi avatar patricklabatut avatar ppwwyyxx avatar puhuk avatar rajprateek avatar raymondcm avatar rbgirshick avatar sampepose avatar superirabbit avatar theschnitz avatar tkhe avatar vkhalidov avatar wangg12 avatar wat3rbro avatar wenliangzhao2018 avatar xingyizhou 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

centernet2's Issues

Custom dataset classes

📚 Documentation

Hi, I wonder how to register custom dataset classes, since I already tried to train with custom dataset and getting this error.

Traceback (most recent call last):
  File "train_net.py", line 228, in <module>
    args=(args,),
  File "/usr/local/lib/python3.7/dist-packages/detectron2/engine/launch.py", line 62, in launch
    main_func(*args)
  File "train_net.py", line 208, in main
    do_train(cfg, model, resume=args.resume)
  File "train_net.py", line 108, in do_train
    data_loader = build_detection_train_loader(cfg, mapper=mapper)
  File "/usr/local/lib/python3.7/dist-packages/detectron2/config/config.py", line 201, in wrapped
    explicit_args = _get_args_from_config(from_config, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/detectron2/config/config.py", line 238, in _get_args_from_config
    ret = from_config_func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/build.py", line 314, in _train_loader_from_config
    proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None,
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/build.py", line 227, in get_detection_dataset_dicts
    dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/build.py", line 227, in <listcomp>
    dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/catalog.py", line 58, in get
    return f()
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/datasets/coco.py", line 489, in <lambda>
    DatasetCatalog.register(name, lambda: load_coco_json(json_file, image_root, name))
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/datasets/coco.py", line 80, in load_coco_json
    meta.thing_classes = thing_classes
  File "/usr/local/lib/python3.7/dist-packages/detectron2/data/catalog.py", line 150, in __setattr__
    "to a different value!\n{} != {}".format(key, self.name, oldval, val)
AssertionError: Attribute 'thing_classes' in the metadata of 'coco_2017_train' cannot be set to a different value!
['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush'] != ['class1', 'class2', 'class3']

where is the definition of loss function?

Hi, Thank you for your great work. I'm wondering where is the definition of the loss function? As you claimed in paper, you jointly optimize two lower bounds for background samples. so, can you show me which part of the code implement this?

CenterTrack2?

Hi, just curious, will you be implementing a CenterTrack2 to go along with this?

Training GPU Setup

📚 Documentation

I have seen it noted the GPUs used for inference. I was hoping you could share what GPU setup you used to train the models, particularly the R2-101-DCN-BiFPN variants.

why add strides_expanded / 2?

📚 Documentation

In the CenterNet2/centernet/modeling/dense_heads/centernet.py file, when calculating the distribution of center points, centers_discret = ((centers_expanded / strides_expanded).int() * strides_expanded).float() + trides_expanded / 2 # M x N x 2, why add strides_expanded / 2?

Can not reproduce the effect

I train model of CenterNet2_R50_1x , use v100 8gpus, but the best AP is 40.26, lower of 42.9; Can you give me some suggestions ?
I use the floowing configs:

DATASETS:
TRAIN: ("coco_2017_train",)
TEST: ("coco_2017_val",)
SOLVER:
IMS_PER_BATCH: 16
BASE_LR: 0.02
STEPS: (60000, 80000)
MAX_ITER: 90000
CHECKPOINT_PERIOD: 1000000000
WARMUP_ITERS: 4000
WARMUP_FACTOR: 0.00025
CLIP_GRADIENTS:
ENABLED: True
INPUT:
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)

detectron2/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass

Tried to " python ./projects/CenterNet2/demo.py --config-fi4le ./projects/CenterNet2/configs/CenterNet2_DLA-BiFPN-P5_640_24x_ST.yaml --input ~/Downloads/dataset/2014/ --opts MODEL.WEIGHTS ./model/CenterNet2_DLA-BiFPN-P5_640_24x_ST.pth"
** fvcore version of PathManager will be deprecated soon. **
** Please migrate to the version in iopath repo. **
https://github.com/facebookresearch/iopath

Traceback (most recent call last):
File "./projects/CenterNet2/demo.py", line 11, in
from detectron2.data.detection_utils import read_image
File "/home/user/anaconda3/lib/python3.7/site-packages/detectron2/data/init.py", line 4, in
from .build import (
File "/home/user/anaconda3/lib/python3.7/site-packages/detectron2/data/build.py", line 12, in
from detectron2.structures import BoxMode
File "/home/user/anaconda3/lib/python3.7/site-packages/detectron2/structures/init.py", line 6, in
from .keypoints import Keypoints, heatmaps_to_keypoints
File "/home/user/anaconda3/lib/python3.7/site-packages/detectron2/structures/k

detectron2/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass

How is the class-agnostic detection score carried to the 2nd stage?

can you show me which part of the code implements this? (what you claimed in paper section 4-Detector design)

the way i see it is that: you replace traditional 2 stage detector's RPN with a strong proposal generator. and I don't see how it suddenly makes the network probabilistic.

about the demo.py

when I run the demo, it put the problems as follows:
WARNING [03/19 18:46:45 d2.config.compat]: Config 'configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml' has no VERSION. Assuming it to be compatible with latest v2.
and:
AssertionError: Checkpoint output/r2_101.pkl not found!
I am a beginer, and actually don't know what's that mean, so can you tell me how to solve it?
oh now I know where to download r2_101.pkl, but I don't the root path to set it, The root directory of the file ?

CenterNet topk points

📚 Documentation

Hello, I would like to set topk quantity for Center points on validation. How should I do this?

datset issue

Hi,when I train the model on my own dataset,I find total number of the dataset which is shown in the picture is not equal to the actual number of dataset,what lead to this problem。
image
As shown in the picture, It says total picture number is 83810,but actually picture number is 49105。

i hope that this version of centernet can detect the keypoint

🚀 Feature

A clear and concise description of the feature proposal.

Motivation & Examples

Tell us why the feature is useful.

Describe what the feature would look like, if it is implemented.
Best demonstrated using code examples in addition to words.

Note

We only consider adding new features if they are relevant to many users.

If you request implementation of research papers -- we only consider papers that have enough significance and prevalance in the object detection field.

We do not take requests for most projects in the projects/ directory, because they are research code release that is mainly for other researchers to reproduce results.

"Make X faster/accurate" is not a valid feature request. "Implement a concrete feature that can make X faster/accurate" can be a valid feature request.

Instead of adding features inside detectron2,
you can implement many features by extending detectron2.
The projects/ directory contains many of such examples.

what is the purpose of CENTERNET.IGNORE_HIGH_FP ?

what is the purpose of CENTERNET.IGNORE_HIGH_FP ?
In the heatmap_focal_loss code, it seems to ignore the loss of high FP ? Isn't the loss of high FP more important?
if ignore_high_fp > 0: not_high_fp = (pred < ignore_high_fp).float() neg_loss = not_high_fp * neg_loss

"No object named 'build_p67_resnet_fpn_backbone' found in 'BACKBONE' registry!"

Hello ~ Thank you for answer my question ~

When run demo.py there is error as bellow:

Config 'projects/CenterNet2/configs/CenterNet2_R50_1x.yaml' has no VERSION. Assuming it to be compatible with latest v2.
Traceback (most recent call last):
File "projects/CenterNet2/demo/demo.py", line 83, in
demo = VisualizationDemo(cfg)
File "/home/mayc1/PyProject/detectron2/projects/CenterNet2/demo/predictor.py", line 35, in init
self.predictor = DefaultPredictor(cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/engine/defaults.py", line 283, in init
self.model = build_model(self.cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/modeling/meta_arch/build.py", line 22, in build_model
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/config/config.py", line 174, in wrapped
explicit_args = _get_args_from_config(from_config_func, *args, **kwargs)
File "/home/mayc1/PyProject/detectron2/detectron2/config/config.py", line 229, in _get_args_from_config
ret = from_config_func(*args, **kwargs)
File "/home/mayc1/PyProject/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 72, in from_config
backbone = build_backbone(cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/modeling/backbone/build.py", line 31, in build_backbone
backbone = BACKBONE_REGISTRY.get(backbone_name)(cfg, input_shape)
File "/home/mayc1/anaconda3/lib/python3.8/site-packages/fvcore/common/registry.py", line 71, in get
raise KeyError(
KeyError: "No object named 'build_p67_resnet_fpn_backbone' found in 'BACKBONE' registry!"

when I start train 2 gpu though python train_net.py --config ./output/CenterNet2/CenterNet-S4_DLA_8x/config.yaml --num-gpus 2 ,when start test ,the model have wrong following :

pre_nms_top_n = candidate_inds.contiguous().view(N, -1).sum(1) # N
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
I change model as (ccandidate_inds.contiguous().view(N, -1).sum(1) # N),but
stall have wrong ,can you help me ?

How to train in VOC

📚 Documentation

Hi, Thanks for your wonderful work,Could you teach me how to train in VOC2012?

Get error when run demo.py

run: python projects/CenterNet2/demo.py --config-file projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml --opts MODEL.WEIGHTS models/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.pth --input images/tupian/*
the error is below:
WARNING [03/23 03:24:43 d2.config.compat]: Config 'projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml' has no VERSION. Assuming it to be compatible with latest v2. Traceback (most recent call last): File "projects/CenterNet2/demo.py", line 78, in <module> cfg = setup_cfg(args) File "projects/CenterNet2/demo.py", line 28, in setup_cfg cfg.merge_from_list(args.opts) File "/opt/conda/lib/python3.8/site-packages/fvcore-0.1.3.post20210317-py3.8.egg/fvcore/common/config.py", line 134, in merge_from_list File "/opt/conda/lib/python3.8/site-packages/yacs-0.1.8-py3.8.egg/yacs/config.py", line 243, in merge_from_list _assert_with_logging(subkey in d, "Non-existent key: {}".format(full_key)) File "/opt/conda/lib/python3.8/site-packages/yacs-0.1.8-py3.8.egg/yacs/config.py", line 545, in _assert_with_logging assert cond, msg AssertionError: Non-existent key: --input

cannot import name 'nonzero_tuple' from 'detectron2.layers'

cannot import name 'nonzero_tuple' from 'detectron2.layers'

I ran the code using Google Colab

  1. Full runnable code or full changes you made:
!pip install cython pyyaml==5.1
!pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
import torch, torchvision
print(torch.__version__, torch.cuda.is_available())
!gcc --version


# install detectron2:
!pip install detectron2==0.1.3 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html

# cloning centernet2 repository
!git clone https://github.com/xingyizhou/CenterNet2.git

# install detectron2:
!pip install detectron2==0.1.3 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html
  1. What exact command you run:
#run training
%cd /content/CenterNet2/projects/CenterNet2
!python train_net.py --config-file configs/CenterNet-FPN_R50_1x.yaml --num-gpus 1
  1. Full logs or other relevant observations:
/content/CenterNet2/projects/CenterNet2
Traceback (most recent call last):
  File "train_net.py", line 38, in <module>
    from centernet.config import add_centernet_config
  File "/content/CenterNet2/projects/CenterNet2/centernet/__init__.py", line 3, in <module>
    from .modeling.roi_heads.custom_roi_heads import CustomROIHeads, CustomCascadeROIHeads
  File "/content/CenterNet2/projects/CenterNet2/centernet/modeling/roi_heads/custom_roi_heads.py", line 19, in <module>
    from .custom_fast_rcnn import CustomFastRCNNOutputLayers
  File "/content/CenterNet2/projects/CenterNet2/centernet/modeling/roi_heads/custom_fast_rcnn.py", line 13, in <module>
    from detectron2.layers import Linear, ShapeSpec, batched_nms, cat, nonzero_tuple
ImportError: cannot import name 'nonzero_tuple' from 'detectron2.layers' (/usr/local/lib/python3.7/dist-packages/detectron2/layers/__init__.py)

Expected behavior:

The initialization from centernet config runs, but since no dataset supported, it will not start the training process.

Environment:

Google colab

problem with registering custom dataset

command Line Args: Namespace(config_file='/content/CenterNet2/projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml', dist_url='tcp://127.0.0.1:23538', eval_only=False, machine_rank=0, manual_device='', num_gpus=1, num_machines=1, opts=[], resume=False)
Config '/content/CenterNet2/projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml' has no VERSION. Assuming it to be compatible with latest v2.
Traceback (most recent call last):
File "/content/CenterNet2/projects/CenterNet2/train_net.py", line 227, in
args=(args,),
File "/usr/local/lib/python3.7/dist-packages/detectron2/engine/launch.py", line 62, in launch
main_func(*args)
File "/content/CenterNet2/projects/CenterNet2/train_net.py", line 187, in main
cfg = setup(args)
File "/content/CenterNet2/projects/CenterNet2/train_net.py", line 175, in setup
cfg.merge_from_file(args.config_file)
File "/usr/local/lib/python3.7/dist-packages/detectron2/config/config.py", line 54, in merge_from_file
self.merge_from_other_cfg(loaded_cfg)
File "/usr/local/lib/python3.7/dist-packages/fvcore/common/config.py", line 123, in merge_from_other_cfg
return super().merge_from_other_cfg(cfg_other)
File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 217, in merge_from_other_cfg
_merge_a_into_b(cfg_other, self, self, [])
File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 474, in _merge_a_into_b
v = _check_and_coerce_cfg_value_type(v, b[k], k, full_key)
File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 537, in _check_and_coerce_cfg_value_type
original_type, replacement_type, original, replacement, full_key
ValueError: Type mismatch (<class 'detectron2.config.config.CfgNode'> vs. <class 'str'>) with values (PRECOMPUTED_PROPOSAL_TOPK_TEST: 1000
PRECOMPUTED_PROPOSAL_TOPK_TRAIN: 2000
PROPOSAL_FILES_TEST: ()
PROPOSAL_FILES_TRAIN: ()
TEST: ()
TRAIN: () vs. TRAIN = ('my_dataset_train',) TEST = ('my_dataset_test',)) for config key: DATASETS

thanks for this amazing work , I am running into this issue after I register my dataset
i am using colab and before running
!python /content/CenterNet2/projects/CenterNet2/train_net.py --config /content/CenterNet2/projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml
I am registering the dataset like this
from detectron2.data.datasets import register_coco_instances
register_coco_instances("my_dataset_train", {}, "/content/results/yolo2coco/train.json", "/content/results/yolo2coco/train")
#register_coco_instances("my_dataset_val", {}, "/content/results/yolo2coco/test.json", "/content/results/yolo2coco/valid")
register_coco_instances("my_dataset_test", {}, "/content/results/yolo2coco/test.json", "/content/results/yolo2coco/test")
and adding the name my_dataset_train and my_dataset_test in config
Could you please help me out .

run demo.py error

I added config,and then run demo.py, there is a new error as bellow: (My torch version is '1.8.1+cu111', on ubuntu 20.4)

Config 'projects/CenterNet2/configs/CenterNet2_R50_1x.yaml' has no VERSION. Assuming it to be compatible with latest v2.
Traceback (most recent call last):
File "projects/CenterNet2/demo/demo.py", line 83, in
demo = VisualizationDemo(cfg)
File "/home/mayc1/PyProject/detectron2/projects/CenterNet2/demo/predictor.py", line 35, in init
self.predictor = DefaultPredictor(cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/engine/defaults.py", line 283, in init
self.model = build_model(self.cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/modeling/meta_arch/build.py", line 22, in build_model
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/config/config.py", line 174, in wrapped
explicit_args = _get_args_from_config(from_config_func, *args, **kwargs)
File "/home/mayc1/PyProject/detectron2/detectron2/config/config.py", line 229, in _get_args_from_config
ret = from_config_func(*args, **kwargs)
File "/home/mayc1/PyProject/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 72, in from_config
backbone = build_backbone(cfg)
File "/home/mayc1/PyProject/detectron2/detectron2/modeling/backbone/build.py", line 31, in build_backbone
backbone = BACKBONE_REGISTRY.get(backbone_name)(cfg, input_shape)
File "/home/mayc1/anaconda3/lib/python3.8/site-packages/fvcore/common/registry.py", line 71, in get
raise KeyError(
KeyError: "No object named 'build_p67_resnet_fpn_backbone' found in 'BACKBONE' registry!"

Config file issue

Hi guys,
Thanks for the good job!
I tried to run the pretrained models on my own images. I downloaded the 'CenterNet-S4_DLA_8x.yaml' from the model zoo. However, when I try to run the code below I get an error with the yaml file (when running cfg.merge_from_file).
This occurs with the other pretrained models too.
Below is the code:


from detectron2.utils.logger import setup_logger
setup_logger()
import cv2
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import MetadataCatalog

im = cv2.imread(r"/data/disk0/data/mekhalfi/centernet2/test2017/000000002343.jpg")

cfg = get_cfg()
cfg.merge_from_file("/home/username/Downloads/CenterNet-S4_DLA_8x.yaml")
cfg.MODEL.WEIGHTS = "/home/username/Downloads/CenterNet-S4_DLA_8x.pth"

cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5
predictor = DefaultPredictor(cfg)
outputs = predictor(im)
MetadataCatalog.get(cfg.DATASETS.TRAIN[0]).thing_classes = ['Apple','Oranges']
v = Visualizer(im[:, :, ::-1], MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
v = v.draw_instance_predictions(outputs["instances"].to("cpu"))
cv2.imshow('',v.get_image()[:, :, ::-1])
cv2.waitKey(0)


ScannerError: mapping values are not allowed here
in "/home/username/Downloads/CenterNet-S4_DLA_8x.yaml", line 107, column 65

Centernet2 to torch.jit.trace

It is throwing whole bunch of errors where constants are used in the custom heads/backbones. Can we get a jit.trace- able centernet2 ?

What are the difference Custom ROI head layers?

📚 Documentation

Hi! Again. Thanks for opensouring the code.
I wonder the main differences between "CustomCascadeROIHeads" "CustomFastRCNNOutputLayers" and original "CascadeROIHeads" and "FastRCNNOutputLayers" ?

What are the results of using original modules by replacing RPN with CenterNet ?

how to use centernet* only

hi,xingyi, thanks for your work, I I just want to use centernet*(FPN) to do pose estimate instead of two stage detector , what should I do, looking for your reply, thanks again!

Commercial issue

Hi,I want to use CenterNet2 in a commercial project,But I read your Lincence which says BiFPN can not use in commercial,How can I achieve commercial use about CenteNet2 which uses BiFPN?
Thanks!

I got an error when I train CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST

I trained :
python ./tools/train_net.py --config-file ./configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml --num-gpus 1 SOLVER.IMS_PER_BATCH 2 SOLVER.BASE_LR 0.0025
image
Susccessful!!
But I run :
python ./projects/CenterNet2/train_net.py --config-file ./projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml --num-gpus 1 SOLVER.IMS_PER_BATCH 2

image
There is an error, I don't know why?

The problem of training custom datasets

Thanks for your great work!
When I train my custom datasets, I used the command:
python ./train_net.py --num-gpus 1 --config-file ./configs/CenterNet2_R50_1x.yaml
but I met the follow problems:
`No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
No instances! torch.Size([0, 3]) torch.Size([0, 4]) 4
No instance in box reg loss
Traceback (most recent call last):
File "./train_net.py", line 237, in
launch(
File "e:\pytorchpro\centernet2-master\detectron2\engine\launch.py", line 62, in launch
main_func(*args)
File "./train_net.py", line 224, in main
do_train(cfg, model, resume=args.resume)
File "./train_net.py", line 128, in do_train
loss_dict = model(data)
File "D:\ProgramData\Anaconda3\envs\CenterNet2\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "e:\pytorchpro\centernet2-master\detectron2\modeling\meta_arch\rcnn.py", line 160, in forward
proposals, proposal_losses = self.proposal_generator(images, features, gt_instances)
File "D:\ProgramData\Anaconda3\envs\CenterNet2\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\PytorchPro\CenterNet2-master\projects\CenterNet2\centernet\modeling\dense_heads\centernet.py", line 109, in forward
losses = self.losses(
File "E:\PytorchPro\CenterNet2-master\projects\CenterNet2\centernet\modeling\dense_heads\centernet.py", line 156, in losses
assert (torch.isfinite(reg_pred).all().item())
AssertionError

How can I solve the problem? Thank you !`

SOI of centernet head

📚 Documentation

what does the parameters SOI of Centernet means,it looks like anchors of RCNN detector,but what is the real meaning of it and how to set for my owndataset?

demo.py bug

(base) E:\cver>python CenterNet2-master/demo/demo.py --config-file CenterNet2-master/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST
.yaml --input E:\cver\images\01_University_Canteen/ --opts MODEL.WEIGHTS CenterNet2-master/configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1
560_ST.pth
[03/18 13:27:40 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='CenterNet2-master/configs/CenterNet2_R2-101-D
CN-BiFPN_4x+4x_1560_ST.yaml', input=['E:\cver\images\01_University_Canteen/'], opts=['MODEL.WEIGHTS', 'CenterNet2-master/configs/Ce
nterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.pth'], output=None, video_input=None, webcam=False)
Traceback (most recent call last):
File "CenterNet2-master/demo/demo.py", line 83, in
cfg = setup_cfg(args)
File "CenterNet2-master/demo/demo.py", line 28, in setup_cfg
cfg.merge_from_file(best_config)
File "e:\cver\detectron2\detectron2\config\config.py", line 30, in merge_from_file
assert PathManager.isfile(cfg_filename), f"Config file '{cfg_filename}' does not exist!"
AssertionError: Config file 'configs/CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml' does not exist!

KeyError: 'Non-existent config key: MODEL.ROI_BOX_HEAD.MULT_PROPOSAL_SCORE'

when I am trying to train the center2 with my own data, here is an error.

File "/home/atesi3/anaconda3/envs/torch18/lib/python3.6/site-packages/yacs/config.py", line 491, in _merge_a_into_b
raise KeyError("Non-existent config key: {}".format(full_key))
KeyError: 'Non-existent config key: MODEL.ROI_BOX_HEAD.MULT_PROPOSAL_SCORE'

Which version of the yacs did you use? or which version of the detectron2? Plese help.

Error :AssertionError: Box tensor contains infinite or NaN!

📚 Documentation

I used the coco dataset to train centernet2, but got a error:

Traceback (most recent call last):
  File "./train_net.py", line 245, in <module>
    args=(args,),
  File "/dataset/datacode/code/CenterNet2/detectron2/engine/launch.py", line 62, in launch
    main_func(*args)
  File "./train_net.py", line 226, in main
    do_train(cfg, model, resume=args.resume)
  File "./train_net.py", line 128, in do_train
    loss_dict = model(data)
  File "/home/das/anaconda3/envs/centernet2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/dataset/datacode/code/CenterNet2/detectron2/modeling/meta_arch/rcnn.py", line 166, in forward
    _, detector_losses = self.roi_heads(images, features, proposals, gt_instances)
  File "/home/das/anaconda3/envs/centernet2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/dataset/datacode/code/CenterNet2/projects/CenterNet2/centernet/modeling/roi_heads/custom_roi_heads.py", line 166, in forward
    losses = self._forward_box(features, proposals, targets)
  File "/dataset/datacode/code/CenterNet2/projects/CenterNet2/centernet/modeling/roi_heads/custom_roi_heads.py", line 116, in _forward_box
    proposals = self._create_proposals_from_boxes(prev_pred_boxes, image_sizes)
  File "/dataset/datacode/code/CenterNet2/detectron2/modeling/roi_heads/cascade_rcnn.py", line 290, in _create_proposals_from_boxes
    boxes_per_image.clip(image_size)
  File "/dataset/datacode/code/CenterNet2/detectron2/structures/boxes.py", line 200, in clip
    assert torch.isfinite(self.tensor).all(), "Box tensor contains infinite or NaN!"
AssertionError: Box tensor contains infinite or NaN!

where is the main wrong? I think the coco dataset is OK

Can't load checkpoint from detectron2://ImageNetPretrained/MSRA/R-50.pkl

Hello, I am very interested in your work. I encountered a few problems while training my samples.
Because my server can't access the external network, I encountered such a problem:

image

Then I found the corresponding R-50.pkl download link in “modelzoo.md” by searching. After downloading it, I replaced "WEIGHTS:“ in “Base-CenterNet2.yaml” with the local path, and then reported this error:

image

I don’t know how to modify the corresponding code... Should I use the local address of the .pkl to replace the online URL? Or how should I do? Looking forward to your reply, thank you very much

Training Loss Clarify

📚 Documentation

Hi, thanks for the paper:
I am a bit confused about the loss implementation. Take the ATSS as RPN as an example:

  1. In the first stage, training the RPN with Focal Loss and IoU loss, identical to ATSS.
  2. In the second stage, training with the Cross Entropy with Softmax output.

My question is about the Second Stage:

  1. Do you still need to predict the Box Regression, since the First Stage already does a very good job?
  2. For the classification, do you train on the product (P(Obj)*P(Cls)) in the second stage ? Or Only on P(Cls) as in conventional Faster-RCNN?

In other word, the training losses are identical to Faster-RCNN. But during inference, you use P(Obj)*P(Cls) as final output ?

Not found Base-CenterNet2.yaml.

Hi,i want to use CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml to demo ,and i have download CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml and CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.pth, but i can't find the file of Base-CenterNet2.yaml.so how can i download it.thank you.

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.