Git Product home page Git Product logo

centernet's Introduction

centernet's People

Contributors

198808xc avatar duankaiwen 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

centernet's Issues

Segmentation fault for "left, right pooling"

Thanks for sharing your work.

I used pytorch-0.4.1, CUDA9.0 and python 3.5 to run the code.
When I used the command "python setup.py install" command to install "pooling", it successfully installes cpools.
But when code runs the first left_pooling, it shows segmentation fault error.
Any advice will be appreciated, thanks

how to change the input picture's dimension

Hi, I am trying to use my own dataset and the image is 1024*2048. I changed the 'input size' of 'db', in config/CenterNet104.json. But I got the following errors:

Traceback (most recent call last):
File "train.py", line 207, in
train(training_dbs, validation_db, args.start_iter)
File "train.py", line 139, in train
training_loss, focal_loss, pull_loss, push_loss, regr_loss = nnet.train(**training)
File "/home/mingzhi/Downloads/CenterNet-master/nnet/py_factory.py", line 82, in train
loss_kp = self.network(xs, ys)
File "/home/mingzhi/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/mingzhi/Downloads/CenterNet-master/models/py_utils/data_parallel.py", line 68, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/mingzhi/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/mingzhi/Downloads/CenterNet-master/nnet/py_factory.py", line 21, in forward
loss_kp = self.loss(preds, ys, **kwargs)
File "/home/mingzhi/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/mingzhi/Downloads/CenterNet-master/models/py_utils/kp.py", line 339, in forward
pull, push = self.ae_loss(tl_tag, br_tag, gt_mask)
File "/home/mingzhi/Downloads/CenterNet-master/models/py_utils/kp_utils.py", line 224, in _ae_loss
dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2)
RuntimeError: Dimension out of range (expected to be in range of [-2, 1], but got 2)

Testing or Exporting without NVIDIA/CUDA?

Is it possible to test the trained model without having an NVIDIA graphics card and CUDA installed? Or even better to somehow export the trained model in a format like .pb?

I tried to evaluate the trained model and I get the message: Cuda driver version is insufficient for CUDA runtime version. This is obvious because I don't have an NVIDIA graphics card and therefore no CUDA installed.

RuntimeError: Expected object of type Variable but found type CUDAType for argument #0 'result'

Anyone can help me with this problem here? This is the logs. Really appreciate it.

RuntimeError: Expected object of type Variable but found type CUDAType for argument #0 'result' (checked_cast_variable at /opt/conda/conda-bld/pytorch_1556653099582/work/torch/csrc/autograd/VariableTypeManual.cpp:173)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x45 (0x7f270e481dc5 in /home/supernode/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: torch::autograd::VariableType::checked_cast_variable(at::Tensor&, char const*, int) + 0x169 .............................................

Iteration stop updating unexpectedly in training

Thank you for your brilliant work and code.I was training on my own datasets which is format in the same format as coco,the place I made some slight changes is the 'categories' and 'outdim',and adjust the batch size.It works well at the beginning of training,but iteration stop updating after several steps.There are no errors at the very beginning.But after I recreating the environment,some errors occur,like
'

File "train.py", line 43, in prefetch_data
    data, ind = sample_data(db, ind, data_aug=data_aug)
  File "../CenterNet/sample/coco.py", line 199, in sample_data
    return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
  File "../CenterNet/sample/coco.py", line 169, in kp_detection
    tl_regrs[b_ind, tag_ind, :]  = [fxtl - xtl, fytl - ytl]
IndexError: index 128 is out of bounds for axis 1 with size 128
Process Process-4:
Traceback (most recent call last):
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "train.py", line 47, in prefetch_data
    raise e
  File "train.py", line 43, in prefetch_data
    data, ind = sample_data(db, ind, data_aug=data_aug)
  File "../CenterNet/sample/coco.py", line 199, in sample_data
    return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
  File "../PycharmProjects/CenterNet/sample/coco.py", line 169, in kp_detection
    tl_regrs[b_ind, tag_ind, :]  = [fxtl - xtl, fytl - ytl]
IndexError: index 128 is out of bounds for axis 1 with size 128
  2%| | 1048/48000 [12:19<9:12:11,  1.42it/s]Exception in thread Thread-1:
Traceback (most recent call last):
  File "../.conda/envs/CenterNet/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "../.conda/envs/CenterNet/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "train.py", line 51, in pin_memory
    data = data_queue.get()
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/queues.py", line 113, in get
    return _ForkingPickler.loads(res)
  File "../.conda/envs/CenterNet/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 151, in rebuild_storage_fd
    fd = df.detach()
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/resource_sharer.py", line 57, in detach
    with _resource_sharer.get_connection(self._id) as conn:
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/resource_sharer.py", line 87, in get_connection
    c = Client(address, authkey=process.current_process().authkey)
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/connection.py", line 487, in Client
    c = SocketClient(address)
  File "../.conda/envs/CenterNet/lib/python3.6/multiprocessing/connection.py", line 614, in SocketClient
    s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

training loss at iteration 1050: 8.643182754516602
focal loss at iteration 1050:    8.27330493927002
pull loss at iteration 1050:     0.02936428226530552
push loss at iteration 1050:     0.1124843955039978
regr loss at iteration 1050:     0.2280292809009552
training loss at iteration 1055: 10.512767791748047
focal loss at iteration 1055:    10.169354438781738
pull loss at iteration 1055:     0.014561626128852367
push loss at iteration 1055:     0.06111855432391167
regr loss at iteration 1055:     0.2677331566810608
  2%| | 1055/48000 [12:24<9:12:05,  1.42it/s]

'
and freeze at this step.The project is still running on GPU when I watch in terminal.
Could anybody tell me how to fix it?Thanks for your patience.

a test problem

hello, i run test.py ,but has a error
this is the test error
Traceback (most recent call last):
File "test.py", line 99, in
test(testing_db, args.split, args.testiter, args.debug, args.suffix)
File "test.py", line 61, in test
testing(db, nnet, result_dir, debug=debug)
File "/home/lz/python/CenterNet/CenterNet-master/test/coco.py", line 321, in testing
return globals()[system_configs.sampling_function](db, nnet, result_dir, debug=debug)
File "/home/lz/python/CenterNet/CenterNet-master/test/coco.py", line 317, in kp_detection
db.evaluate(result_json, cls_ids, image_ids)
File "/home/lz/python/CenterNet/CenterNet-master/db/coco.py", line 176, in evaluate
coco_dets = coco.loadRes(result_json)
File "data/coco/PythonAPI/pycocotools/coco.py", line 318, in loadRes
if 'caption' in anns[0]:
IndexError: list index out of range

this is log
cfg_file: config/CenterNet-104.json
loading all datasets...
split: minival
loading from cache file: cache/coco_minival2014.pkl
loading annotations into memory...
Done (t=0.33s)
creating index...
index created!
system config...
{'batch_size': 2,
'cache_dir': 'cache',
'chunk_sizes': [2],
'config_dir': 'config',
'data_dir': './data',
'data_rng': <mtrand.RandomState object at 0x7f6dd59b9990>,
'dataset': 'MSCOCO',
'decay_rate': 10,
'display': 5,
'learning_rate': 0.00025,
'max_iter': 480000,
'nnet_rng': <mtrand.RandomState object at 0x7f6dd59b99d8>,
'opt_algo': 'adam',
'prefetch_size': 6,
'pretrain': None,
'result_dir': 'results',
'sampling_function': 'kp_detection',
'snapshot': 5000,
'snapshot_name': 'CenterNet-104',
'stepsize': 450000,
'test_split': 'testdev',
'train_split': 'trainval',
'val_iter': 500,
'val_split': 'minival',
'weight_decay': False,
'weight_decay_rate': 1e-05,
'weight_decay_type': 'l2'}
db config...
{'ae_threshold': 0.5,
'border': 128,
'categories': 80,
'data_aug': True,
'gaussian_bump': True,
'gaussian_iou': 0.7,
'gaussian_radius': -1,
'input_size': [511, 511],
'kp_categories': 1,
'lighting': True,
'max_per_image': 100,
'merge_bbox': False,
'nms_algorithm': 'exp_soft_nms',
'nms_kernel': 3,
'nms_threshold': 0.5,
'output_sizes': [[128, 128]],
'rand_color': True,
'rand_crop': True,
'rand_pushes': False,
'rand_samples': False,
'rand_scale_max': 1.4,
'rand_scale_min': 0.6,
'rand_scale_step': 0.1,
'rand_scales': array([0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3]),
'special_crop': False,
'test_scales': [1],
'top_k': 70,
'weight_exp': 8}
loading parameters at iteration: 480000
building neural network...
module_file: models.CenterNet-104
total parameters: 210062960
loading parameters...
loading model from cache/nnet/CenterNet-104/CenterNet-104_480000.pkl

thanks for your help

CornerNet has recently been upgraded to CornerNet-Lite, and has made great progress. Do you have a comparison of the efficiency and time of testing with CornerNet's AP detection?

CornerNet has recently been upgraded to CornerNet-Lite, and has made great progress. Do you have a comparison of the efficiency and time of testing with CornerNet's AP detection? THX!

https://github.com/princeton-vl/CornerNet-Lite

Code for reproducing results in the following paper:

CornerNet-Lite: Efficient Keypoint Based Object Detection CornerNet-Lite:基于关键点的高效对象检测
Hei Law, Yun Teng, Olga Russakovsky, Jia Deng
arXiv:1904.08900

About pooling code

Where is the core code of center pooling and cascade pooling? Thanks a lot.

training myself datasets

hi, when training my own datasets, the pull loss,push loss and regr loss are all zeros, training loss and focal loss are not zeros, can you tell me is there any problem?

fault with "python setup.py install --user"

Thank you for your work and code. I have some faults when compile C++ file using "python setup.py install --user", like followings:
/opt/anaconda3/envs/py36/lib/python3.6/site-packages/torch/lib/include/torch/csrc/variable_tensor_functions.h:35:52 note: declared here
AT_DEPRECATED(THP_CLASS at::TypeExtendedInterface& CUDA(at::ScalarType type));
^
/opt/anaconda3/envs/py36/lib/python3.6/site-packages/torch/lib/include/ATen/core/Deprecated.h:9:61: note: in definition of macro 'AT_DEPRECATED'
#define AT_DEPRECATED(function) attribute((deprecated)) function
^~~~~~~~
src/top_pool.cpp:57:44: error: could not convert 'torch::CUDA((c10::ScalarType)0)' from 'at::TypeExtendedInterface' to 'c10::IntList {aka c10::ArrayRef}'
auto gt_mask = at::zeros(torch::CUDA(at::kByte), {batch, channel, width});
~~~~~~~~~~~^~~~~~~~~~~
src/top_pool.cpp:58:40: warning: 'at::TypeExtendedInterface& torch::CUDA(c10::ScalarType)' is deprecated [-Wdeprecated-declarations]
auto max_temp = at::zeros(torch::CUDA(at::kFloat), {batch, channel, width});

it just a part of the faults, Can you give me some advice to solve this problem? thanks

train error!!!!help help help !!!help me

File "/home/xinyu/anaconda3/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/home/xinyu/anaconda3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 47, in prefetch_data
raise e
File "train.py", line 43, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/xinyu/CenterNet-master/sample/coco.py", line 199, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/xinyu/CenterNet-master/sample/coco.py", line 99, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/xinyu/CenterNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last):
File "train.py", line 43, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/xinyu/CenterNet-master/sample/coco.py", line 199, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/xinyu/CenterNet-master/sample/coco.py", line 99, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/xinyu/CenterNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Process Process-4:
Traceback (most recent call last):
File "/home/xinyu/anaconda3/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/home/xinyu/anaconda3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 47, in prefetch_data
raise e
File "train.py", line 43, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/xinyu/CenterNet-master/sample/coco.py", line 199, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/xinyu/CenterNet-master/sample/coco.py", line 99, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/xinyu/CenterNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
total parameters: 210062960
setting learning rate to: 0.00025
training start...
0%| | 0/480000 [00:00<?, ?it/s]

train error!!!

thx for your code, but i have got the error when training ,stop at
image
what happened ?

Why is the test result incorrect?

I used the trained model:
python test.py CenterNet-104 --testiter 480000 --split <split>
and get a file result.json,but when I try to draw the detection box through bbox use opencv,I had problems.
cv.rectangle(src, (int(bbox[0]), int(bbox[1])), (int(bbox[2]), int(bbox[3])), (0, 255,0),1)
Screenshot from 2019-05-05 19-34-12
{"image_id": 466319, "category_id": 1, "bbox": [199.02, 90.37, 135.19, 336.08], "score": 0.94}
could you tell me the meaning of four parameters in bbox?

test model error

run python test.py CenterNet-104 --testiter 480000 --split validation
error msg:
loading parameters at iteration: 480000
building neural network...
module_file: models.CenterNet-104
total parameters: 210062960
loading parameters...
loading model from cache/nnet/CenterNet-104/CenterNet-104_480000.pkl
Traceback (most recent call last):
File "test.py", line 99, in
test(testing_db, args.split, args.testiter, args.debug, args.suffix)
File "test.py", line 54, in test
nnet.load_params(test_iter)
File "/CenterNet-keypoint/nnet/py_factory.py", line 132, in load_params
self.model.load_state_dict(params)
File "/env_pyt0.4.0_py3.6_centernet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DummyModule:
Unexpected key(s) in state_dict: "module.pre.0.bn.num_batches_tracked", "module.pre.1.bn1.num_batches_tracked", "module.pre.1.bn2.num_batches_tracked", "module.pre.1.skip.1.num_batches_tracked", "module.kps.0.up1.0.bn1.num_batches_tracked", "module.kps.0.up1.0.bn2.num_batches_tracke

why No such file or directory?

(CenterNet) lf@110:~/CenterNet/CenterNet$ python train.py CenterNet-104
loading all datasets...
using 4 threads
loading from cache file: cache/coco_trainval2014.pkl
No cache file found...
loading annotations into memory...
Traceback (most recent call last):
File "train.py", line 193, in
training_dbs = [datasets[dataset](configs["db"], train_split) for _ in range(threads)]
File "train.py", line 193, in
training_dbs = [datasets[dataset](configs["db"], train_split) for _ in range(threads)]
File "/home/lf/CenterNet/CenterNet/db/coco.py", line 66, in init
self._load_data()
File "/home/lf/CenterNet/CenterNet/db/coco.py", line 75, in _load_data
self._extract_data()
File "/home/lf/CenterNet/CenterNet/db/coco.py", line 102, in _extract_data
self._coco = COCO(self._label_file)
File "data/coco/PythonAPI/pycocotools/coco.py", line 84, in init
dataset = json.load(open(annotation_file, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: '../data/coco/annotations/instances_trainval2014.json'

a coding mistake

mistake as below
https://github.com/Duankaiwen/CenterNet/blob/master/sample/utils.py

def gaussian_radius(det_size, min_overlap):

height, width = det_size



a1  = 1

b1  = (height + width)

c1  = width * height * (1 - min_overlap) / (1 + min_overlap)

sq1 = np.sqrt(b1 ** 2 - 4 * a1 * c1)

r1  = (b1 + sq1) / 2



a2  = 4

b2  = 2 * (height + width)

c2  = (1 - min_overlap) * width * height

sq2 = np.sqrt(b2 ** 2 - 4 * a2 * c2)

r2  = (b2 + sq2) / 2



a3  = 4 * min_overlap

b3  = -2 * min_overlap * (height + width)

c3  = (min_overlap - 1) * width * height

sq3 = np.sqrt(b3 ** 2 - 4 * a3 * c3)

r3  = (b3 + sq3) / 2

return min(r1, r2, r3)

And the correct one
please reference to the
https://github.com/princeton-vl/CornerNet/blob/master/sample/utils.py
like this

def gaussian_radius(det_size, min_overlap):

height, width = det_size



a1  = 1

b1  = (height + width)

c1  = width * height * (1 - min_overlap) / (1 + min_overlap)

sq1 = np.sqrt(b1 ** 2 - 4 * a1 * c1)

r1  = (b1 - sq1) / (2 * a1)



a2  = 4

b2  = 2 * (height + width)

c2  = (1 - min_overlap) * width * height

sq2 = np.sqrt(b2 ** 2 - 4 * a2 * c2)

r2  = (b2 - sq2) / (2 * a2)



a3  = 4 * min_overlap

b3  = -2 * min_overlap * (height + width)

c3  = (min_overlap - 1) * width * height

sq3 = np.sqrt(b3 ** 2 - 4 * a3 * c3)

r3  = (b3 + sq3) / (2 * a3)

return min(r1, r2, r3)

so i hope you can give you Mathematical formula derivation in the readme.md
because which is not same with mine

How to visualize the model

How to visualize network structure?How to print network structure?I can't find the loading model in any of the files.

When training my own datasets, it interrupted

It will stop after show these informations. The bus shows as follow:

File "train.py", line 43, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/zhuyu/CenterNet/sample/coco.py", line 199, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/zhuyu/CenterNet/sample/coco.py", line 169, in kp_detection
tl_regrs[b_ind, tag_ind, :] = [fxtl - xtl, fytl - ytl]
IndexError: index 128 is out of bounds for axis 1 with size 128
Process Process-1:
Traceback (most recent call last):
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 47, in prefetch_data
raise e
File "train.py", line 43, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/zhuyu/CenterNet/sample/coco.py", line 199, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/zhuyu/CenterNet/sample/coco.py", line 169, in kp_detection
tl_regrs[b_ind, tag_ind, :] = [fxtl - xtl, fytl - ytl]
IndexError: index 128 is out of bounds for axis 1 with size 128
training loss at iteration 100: 10.80356502532959
focal loss at iteration 100: 10.398816108703613
pull loss at iteration 100: 0.026798348873853683
push loss at iteration 100: 0.11498038470745087
regr loss at iteration 100: 0.26297056674957275
0%| | 101/480000 [02:48<222:26:08, 1.67s/it]Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 51, in pin_memory
data = data_queue.get()
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/queues.py", line 113, in get
return _ForkingPickler.loads(res)
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 151, in rebuild_storage_fd
fd = df.detach()
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/resource_sharer.py", line 57, in detach
with _resource_sharer.get_connection(self._id) as conn:
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/resource_sharer.py", line 87, in get_connection
c = Client(address, authkey=process.current_process().authkey)
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/connection.py", line 487, in Client
c = SocketClient(address)
File "/home/zhuyu/anaconda3/envs/CenterNet/lib/python3.6/multiprocessing/connection.py", line 614, in SocketClient
s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

Can anyone help me ? Thank you very much!!!

python test.py CenterNet-104 --testiter 20000 --split testing --debug

When I use test.py, there is such error Traceback (most recent call last): File "test.py", line 100, in <module> test(testing_db, args.split, args.testiter, args.debug, args.suffix) File "test.py", line 62, in test testing(db, nnet, result_dir, debug=debug) File "/media/disk/wudi/CenterNet/test/coco.py", line 321, in testing return globals()[system_configs.sampling_function](db, nnet, result_dir, deb File "/media/disk/wudi/CenterNet/test/coco.py", line 290, in kp_detection cat_name = db.class_name(j) File "/media/disk/wudi/CenterNet/db/coco.py", line 106, in class_name cat = self._coco.loadCats([cat_id])[0] File "data/coco/PythonAPI/pycocotools/coco.py", line 218, in loadCats return [self.cats[id] for id in ids] File "data/coco/PythonAPI/pycocotools/coco.py", line 218, in <listcomp> return [self.cats[id] for id in ids] KeyError: 34
I have modified the class id, why occur this error? How to solve it? Thanks.

How to save the model and how to use it next time

Hello there.I wonder how to save the model when I training and how to use it next time.I've noticed that there is a dir named cache , and it stored some parameters like CenterNet-104_iteration.pkl, I don't know whether it is the thing I want,and how to use it next time,like what commands shuold I enter.Thank you very much.

when i generate onnx file ,i got the error.

config["system"]["snapshot_name"] = crf
system_config = SystemConfig().update_config(config["system"])
model_file = "core.models.{}".format(crf)
model_file = importlib.import_module(model_file)
model_c = model_file.model(db)
x = torch.randn(1, 3, 255, 255, requires_grad=True)
torch_out = torch.onnx._export(model_c, x, "super_resolution.onnx", export_params=True)

error :
RuntimeError: ONNX export failed: Couldn't export Python operator TopPoolFunction

Can you give me some suggestion?

models/py_utils/kp_utils.py

The function _ae_loss of file "models/py_utils/kp_utils.py":

whether the code "dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2)"
is change to "dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(-2)"?

ImportError: DLL load failed: 找不到指定的程序。

(py36) PS D:\pythoncode\CenterNet_pytorch_win10_cuda10_py3.68\CenterNet> python test.py CenterNet-104 --testiter 480000

Traceback (most recent call last):
File "test.py", line 25, in
from nnet.py_factory import NetworkFactory
File "D:\pythoncode\CenterNet_pytorch_win10_cuda10_py3.68\CenterNet\nnet\py_factory.py", line 19, in
from models.py_utils.data_parallel import DataParallel
File "D:\pythoncode\CenterNet_pytorch_win10_cuda10_py3.68\CenterNet\models\py_utils_init_.py", line 6, in
from .cpools import TopPool, BottomPool, LeftPool, RightPool
File "D:\pythoncode\CenterNet_pytorch_win10_cuda10_py3.68\CenterNet\models\py_utils_cpools_init
.py", line 8, in
import top_pool, bottom_pool, left_pool, right_pool
ImportError: DLL load failed: 找不到指定的程序。

请问这个是什么原因啊?

请问没有使用正常的 Conv layer 而不是 Deformable 的测试结果呢?

Hi,

CenterNet 的速度和精度都非常棒, 先点个赞。

由于 Deformable 卷积在代码实现层面无法使用例如 TensorCore 之类的加速指令, 所以在实际部署中, 速度是没有普通的Conv 运行的快的。 所以我想请教下 @Duankaiwen 有没有使用普通的卷积 OP把 CenterNet 的框架结合起来的想法?

不知道精度和速度会是怎么样的。

谢谢。

Add demo.py

Hi, thanks for your work. Can you give one demo.py file that can used trained model in images/video/web camera? Thanks a lot.

train error

Traceback (most recent call last):
File "train.py", line 203, in
train(training_dbs, validation_db, args.start_iter)
File "train.py", line 138, in train
training_loss, focal_loss, pull_loss, push_loss, regr_loss = nnet.train(**training)
File "/home/xinyu/CenterNet-master/nnet/py_factory.py", line 82, in train
loss_kp = self.network(xs, ys)
File "/home/xinyu/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, kwargs)
File "/home/xinyu/CenterNet-master/models/py_utils/data_parallel.py", line 66, in forward
inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids, self.chunk_sizes)
File "/home/xinyu/CenterNet-master/models/py_utils/data_parallel.py", line 77, in scatter
return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim, chunk_sizes=self.chunk_sizes)
File "/home/xinyu/CenterNet-master/models/py_utils/scatter_gather.py", line 30, in scatter_kwargs
inputs = scatter(inputs, target_gpus, dim, chunk_sizes) if inputs else []
File "/home/xinyu/CenterNet-master/models/py_utils/scatter_gather.py", line 25, in scatter
return scatter_map(inputs)
File "/home/xinyu/CenterNet-master/models/py_utils/scatter_gather.py", line 18, in scatter_map
return list(zip(map(scatter_map, obj)))
File "/home/xinyu/CenterNet-master/models/py_utils/scatter_gather.py", line 20, in scatter_map
return list(map(list, zip(map(scatter_map, obj))))
File "/home/xinyu/CenterNet-master/models/py_utils/scatter_gather.py", line 15, in scatter_map
return Scatter.apply(target_gpus, chunk_sizes, dim, obj)
File "/home/xinyu/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/_functions.py", line 87, in forward
outputs = comm.scatter(input, ctx.target_gpus, ctx.chunk_sizes, ctx.dim, streams)
File "/home/xinyu/anaconda3/lib/python3.6/site-packages/torch/cuda/comm.py", line 142, in scatter
return tuple(torch._C._scatter(tensor, devices, chunk_sizes, dim, streams))
RuntimeError: CUDA error (10): invalid device ordinal (check_status at /opt/conda/conda-bld/pytorch_1532502421238/work/aten/src/ATen/cuda/detail/CUDAHooks.cpp:36)
frame #0: torch::cuda::scatter(at::Tensor const&, at::ArrayRef, at::optional<std::vector<long, std::allocator > > const&, long, at::optional<std::vector<CUDAStreamInternals
, std::allocator<CUDAStreamInternals
> > > const&) + 0x4e1 (0x7fac77038871 in /home/xinyu/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #1: + 0xc42a0b (0x7fac77040a0b in /home/xinyu/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #2: + 0x38a5cb (0x7fac767885cb in /home/xinyu/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)

frame #13: THPFunction_apply(_object
, _object
) + 0x38f (0x7fac76b66a2f in /home/xinyu/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)

Testing this on my own dataset

Hey how can I integrate this in a project like how can I run it on a bunch of images and get bounding boxes and confidence score in return .

is there a support for cuda9

Hi,thank for your great work.My gpu is TITAN GTX supporting only CUDA9+ and i got error cause your conda env is compiled in cuda80. followed is error:
#######################################################
/home/imdl/anaconda3/envs/centernet/bin/python /home/imdl/workspace/CenterNet-master_train/train.py CenterNet-104
loading all datasets...
using 4 threads
loading from cache file: cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=11.03s)
creating index...
index created!
loading from cache file: cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=10.94s)
creating index...
index created!
loading from cache file: cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=10.05s)
creating index...
index created!
loading from cache file: cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=15.83s)
creating index...
index created!
loading from cache file: cache/coco_minival2014.pkl
loading annotations into memory...
Done (t=0.34s)
creating index...
index created!
system config...
{'batch_size': 48,
'cache_dir': 'cache',
'chunk_sizes': [6, 6, 6, 6, 6, 6, 6, 6],
'config_dir': 'config',
'data_dir': '../data',
'data_rng': <mtrand.RandomState object at 0x7f54a7e6e8b8>,
'dataset': 'MSCOCO',
'decay_rate': 10,
'display': 5,
'learning_rate': 0.00025,
'max_iter': 480000,
'nnet_rng': <mtrand.RandomState object at 0x7f54a7e6e900>,
'opt_algo': 'adam',
'prefetch_size': 6,
'pretrain': None,
'result_dir': 'results',
'sampling_function': 'kp_detection',
'snapshot': 5000,
'snapshot_name': 'CenterNet-104',
'stepsize': 450000,
'test_split': 'testdev',
'train_split': 'trainval',
'val_iter': 500,
'val_split': 'minival',
'weight_decay': False,
'weight_decay_rate': 1e-05,
'weight_decay_type': 'l2'}
db config...
{'ae_threshold': 0.5,
'border': 128,
'categories': 80,
'data_aug': True,
'gaussian_bump': True,
'gaussian_iou': 0.7,
'gaussian_radius': -1,
'input_size': [511, 511],
'kp_categories': 1,
'lighting': True,
'max_per_image': 100,
'merge_bbox': False,
'nms_algorithm': 'exp_soft_nms',
'nms_kernel': 3,
'nms_threshold': 0.5,
'output_sizes': [[128, 128]],
'rand_color': True,
'rand_crop': True,
'rand_pushes': False,
'rand_samples': False,
'rand_scale_max': 1.4,
'rand_scale_min': 0.6,
'rand_scale_step': 0.1,
'rand_scales': array([0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3]),
'special_crop': False,
'test_scales': [1],
'top_k': 70,
'weight_exp': 8}
len of db: 118287
start prefetching data...
shuffling indices...
start prefetching data...
shuffling indices...
start prefetching data...
shuffling indices...
start prefetching data...
shuffling indices...
building model...
module_file: models.CenterNet-104
start prefetching data...
shuffling indices...
total parameters: 210062960
setting learning rate to: 0.00025
training start...
0%| | 0/480000 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/imdl/workspace/CenterNet-master_train/train.py", line 203, in
train(training_dbs, validation_db, args.start_iter)
File "/home/imdl/workspace/CenterNet-master_train/train.py", line 138, in train
training_loss, focal_loss, pull_loss, push_loss, regr_loss = nnet.train(**training)
File "/home/imdl/workspace/CenterNet-master_train/nnet/py_factory.py", line 82, in train
loss_kp = self.network(xs, ys)
File "/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/data_parallel.py", line 66, in forward
inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids, self.chunk_sizes)
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/data_parallel.py", line 77, in scatter
return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim, chunk_sizes=self.chunk_sizes)
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/scatter_gather.py", line 30, in scatter_kwargs
inputs = scatter(inputs, target_gpus, dim, chunk_sizes) if inputs else []
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/scatter_gather.py", line 25, in scatter
return scatter_map(inputs)
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/scatter_gather.py", line 18, in scatter_map
return list(zip(map(scatter_map, obj)))
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/scatter_gather.py", line 20, in scatter_map
return list(map(list, zip(map(scatter_map, obj))))
File "/home/imdl/workspace/CenterNet-master_train/models/py_utils/scatter_gather.py", line 15, in scatter_map
return Scatter.apply(target_gpus, chunk_sizes, dim, obj)
File "/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/nn/parallel/_functions.py", line 87, in forward
outputs = comm.scatter(input, ctx.target_gpus, ctx.chunk_sizes, ctx.dim, streams)
File "/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/cuda/comm.py", line 142, in scatter
return tuple(torch._C._scatter(tensor, devices, chunk_sizes, dim, streams))
RuntimeError: Device index must be -1 or non-negative, got -2111146688 (Device at /opt/conda/conda-bld/pytorch_1535491974311/work/torch/lib/tmp_install/include/ATen/Device.h:47)
frame #0: + 0xc42a0b (0x7f5485c22a0b in /home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #1: + 0x38a5cb (0x7f548536a5cb in /home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #2: _PyCFunction_FastCallDict + 0x154 (0x55ef7b8037c4 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #3: + 0x19c10c (0x55ef7b89110c in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #4: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #5: + 0x1950a6 (0x55ef7b88a0a6 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #6: + 0x1960e1 (0x55ef7b88b0e1 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #7: + 0x19c1e5 (0x55ef7b8911e5 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #8: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #9: PyEval_EvalCodeEx + 0x329 (0x55ef7b88bbf9 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #10: + 0x197a14 (0x55ef7b88ca14 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #11: PyObject_Call + 0x3e (0x55ef7b8035ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #12: THPFunction_apply(_object
, _object
) + 0x38f (0x7f5485748a2f in /home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
frame #13: _PyCFunction_FastCallDict + 0x91 (0x55ef7b803701 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #14: + 0x19c10c (0x55ef7b89110c in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #15: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #16: + 0x1954ce (0x55ef7b88a4ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #17: _PyFunction_FastCallDict + 0x1bb (0x55ef7b88b5bb in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #18: _PyObject_FastCallDict + 0x26f (0x55ef7b803b8f in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #19: + 0x129e32 (0x55ef7b81ee32 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #20: PyIter_Next + 0xe (0x55ef7b84775e in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #21: PySequence_Tuple + 0xf9 (0x55ef7b84c519 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #22: _PyEval_EvalFrameDefault + 0x549b (0x55ef7b8ba5ab in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #23: + 0x1954ce (0x55ef7b88a4ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #24: _PyFunction_FastCallDict + 0x1bb (0x55ef7b88b5bb in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #25: _PyObject_FastCallDict + 0x26f (0x55ef7b803b8f in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #26: + 0x129e32 (0x55ef7b81ee32 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #27: PyIter_Next + 0xe (0x55ef7b84775e in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #28: PySequence_Tuple + 0xf9 (0x55ef7b84c519 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #29: _PyEval_EvalFrameDefault + 0x549b (0x55ef7b8ba5ab in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #30: + 0x1954ce (0x55ef7b88a4ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #31: + 0x1960e1 (0x55ef7b88b0e1 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #32: + 0x19c1e5 (0x55ef7b8911e5 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #33: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #34: + 0x1954ce (0x55ef7b88a4ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #35: + 0x1960e1 (0x55ef7b88b0e1 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #36: + 0x19c1e5 (0x55ef7b8911e5 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #37: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #38: + 0x1950a6 (0x55ef7b88a0a6 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #39: + 0x1960e1 (0x55ef7b88b0e1 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #40: + 0x19c1e5 (0x55ef7b8911e5 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #41: _PyEval_EvalFrameDefault + 0x10bb (0x55ef7b8b61cb in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #42: + 0x195eab (0x55ef7b88aeab in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #43: + 0x19c1e5 (0x55ef7b8911e5 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #44: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #45: + 0x1950a6 (0x55ef7b88a0a6 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #46: _PyFunction_FastCallDict + 0x3db (0x55ef7b88b7db in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #47: _PyObject_FastCallDict + 0x26f (0x55ef7b803b8f in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #48: _PyObject_Call_Prepend + 0x63 (0x55ef7b808773 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #49: PyObject_Call + 0x3e (0x55ef7b8035ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #50: _PyEval_EvalFrameDefault + 0x1a88 (0x55ef7b8b6b98 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #51: + 0x1950a6 (0x55ef7b88a0a6 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #52: _PyFunction_FastCallDict + 0x1bb (0x55ef7b88b5bb in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #53: _PyObject_FastCallDict + 0x26f (0x55ef7b803b8f in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #54: _PyObject_Call_Prepend + 0x63 (0x55ef7b808773 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #55: PyObject_Call + 0x3e (0x55ef7b8035ce in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #56: + 0x16a307 (0x55ef7b85f307 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #57: _PyObject_FastCallDict + 0x8b (0x55ef7b8039ab in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #58: + 0x19c25e (0x55ef7b89125e in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #59: _PyEval_EvalFrameDefault + 0x30a (0x55ef7b8b541a in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #60: + 0x1950a6 (0x55ef7b88a0a6 in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #61: _PyFunction_FastCallDict + 0x3db (0x55ef7b88b7db in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #62: _PyObject_FastCallDict + 0x26f (0x55ef7b803b8f in /home/imdl/anaconda3/envs/centernet/bin/python)
frame #63: _PyObject_Call_Prepend + 0x63 (0x55ef7b808773 in /home/imdl/anaconda3/envs/centernet/bin/python)

terminate called without an active exception~~
###############################################
any help?

python train.py

when I use python train.py CenterNet-104 to train the model, there is such error
Traceback (most recent call last): File "train.py", line 43, in prefetch_data data, ind = sample_data(db, ind, data_aug=data_aug) File "/media/disk/wudi/CenterNet/sample/coco.py", line 200, in sample_data return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug) File "/media/disk/wudi/CenterNet/sample/coco.py", line 100, in kp_detection image, detections = random_crop(image, detections, rand_scales, input_size, border=border) File "/media/disk/wudi/CenterNet/sample/utils.py", line 57, in random_crop image_height, image_width = image.shape[0:2] AttributeError: 'NoneType' object has no attribute 'shape'
whe does the error happen? how to avoid this error? Thanks

Could you explan more about Cascade corner pooling module?

Hi @Duankaiwen ,
I'm reading your paper now, and little confused about the cascade corner pooling layer. You say "It first looks along a boundary to find a boundary maximum value, then looks inside along the location of the boundary maximum value to find a internal maximum value, and finally, add the two maximum values together. By doing this, the corners obtain both the the boundary information and the visual patterns of objects."
I read your code and match it to your figure 5(b) architecture exactly. But I don't really understand this arch. I can understand It first looks along a boundary to find a boundary maximum value, e.g. left pooling, this is same as CornerNet. But how it looks inside along the location of the boundary maximum value to find a internal maximum value, and finally, add the two maximum values together via 3x3-Conv and top pooling?

Thanks.

Compile failed

When i use thepython setup.py install --user it failed,looks like ‘python setup.py build install --user’works for me

what the kps mean?

loading model from cache/nnet/CenterNet-104/CenterNet-104_480000.pkl
locating kps: 0%| | 0/20288 [00:00<?, ?it/s]

RuntimeError: The shape of the mask [1, 1, 128, 128] at index 1 does not match the shape of the indexed tensor [1, 80, 128, 128] at index 1

Hi, thank you for your great work. I build a coco style object detection dataset with only one category. According to your project, I rectified CenterNet-104.json file and finally, I was stuck by the following error. I know that the shape of the mask is [1, 1, 128, 128] (my batch_size==1), I don't know how to change it from [1, 80, 128, 128] to [1, 1, 128, 128] accordingly. Any help would be appreciated!

###############################################
/home/imdl/anaconda3/envs/centernet/bin/python /home/imdl/workspace/CenterNet-master_train_custom_dataset/train.py CenterNet-104
loading all datasets...
using 1 threads
loading from cache file: cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
loading from cache file: cache/coco_minival2014.pkl
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
system config...
{'batch_size': 1,
'cache_dir': 'cache',
'chunk_sizes': [1],
'config_dir': 'config',
'data_dir': '../data',
'data_rng': <mtrand.RandomState object at 0x7f7bf9c02870>,
'dataset': 'MSCOCO',
'decay_rate': 10,
'display': 5,
'learning_rate': 0.00025,
'max_iter': 100000,
'nnet_rng': <mtrand.RandomState object at 0x7f7bf9c028b8>,
'opt_algo': 'adam',
'prefetch_size': 6,
'pretrain': None,
'result_dir': 'results',
'sampling_function': 'kp_detection',
'snapshot': 5000,
'snapshot_name': 'CenterNet-104',
'stepsize': 4500,
'test_split': 'testdev',
'train_split': 'trainval',
'val_iter': 200,
'val_split': 'minival',
'weight_decay': False,
'weight_decay_rate': 1e-05,
'weight_decay_type': 'l2'}
db config...
{'ae_threshold': 0.5,
'border': 128,
'categories': 1,
'data_aug': True,
'gaussian_bump': True,
'gaussian_iou': 0.7,
'gaussian_radius': -1,
'input_size': [511, 511],
'kp_categories': 1,
'lighting': True,
'max_per_image': 100,
'merge_bbox': False,
'nms_algorithm': 'exp_soft_nms',
'nms_kernel': 3,
'nms_threshold': 0.5,
'output_sizes': [[128, 128]],
'rand_color': True,
'rand_crop': True,
'rand_pushes': False,
'rand_samples': False,
'rand_scale_max': 1.4,
'rand_scale_min': 0.6,
'rand_scale_step': 0.1,
'rand_scales': array([0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3]),
'special_crop': False,
'test_scales': [1],
'top_k': 70,
'weight_exp': 8}
len of db: 1451
start prefetching data...
shuffling indices...
building model...
module_file: models.CenterNet-104
start prefetching data...
shuffling indices...
total parameters: 210062960
setting learning rate to: 0.00025
training start...
0%| | 0/100000 [00:00<?, ?it/s]THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCGeneral.cpp line=663 error=11 : invalid argument
/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:122: UserWarning: nn.Upsampling is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.Upsampling is deprecated. Use nn.functional.interpolate instead.")
Traceback (most recent call last):
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/train.py", line 204, in
train(training_dbs, validation_db, args.start_iter)
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/train.py", line 138, in train
training_loss, focal_loss, pull_loss, push_loss, regr_loss = nnet.train(**training)
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/nnet/py_factory.py", line 82, in train
loss_kp = self.network(xs, ys)
File "/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/models/py_utils/data_parallel.py", line 68, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/nnet/py_factory.py", line 21, in forward
loss_kp = self.loss(preds, ys, **kwargs)
File "/home/imdl/anaconda3/envs/centernet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/models/py_utils/kp.py", line 330, in forward
focal_loss += self.focal_loss(tl_heats, gt_tl_heat)
File "/home/imdl/workspace/CenterNet-master_train_custom_dataset/models/py_utils/kp_utils.py", line 180, in _neg_loss
pos_pred = pred[pos_inds]
RuntimeError: The shape of the mask [1, 1, 128, 128] at index 1 does not match the shape of the indexed tensor [1, 80, 128, 128] at index 1

Process finished with exit code 1

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.