-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing this on my own dataset #21
Comments
@chariot1498 Hi, you can modify the "kp_dectection" function in test/coco.py. |
@Duankaiwen I have trained one category object detection centernet based on your project but I found that in test.py my model can only get low scores(about 0.4-0.6). It confused me cause I can obtain 0.46AP and 0.828 AP@0.5. Followed is my test result and screenshot of code
Process finished with exit code 0 |
@li10141110 你好,我训练ok,test出问题: |
your GPU memory is limited. |
set batch size to 1 and chunk_size [1] |
I want to train my own dataset and I format the data to the coco format, change the class_id in the ./db/coco.py, where else should I modify? Thanks |
@li10141110 what's the chunk_sizes means? how can i set gpu id in this project? |
@li10141110 Hi, the scores only affect the order of boxes. |
@NightNightNight chunk_sizes denotes the batch size for each GPU |
@Duankaiwen thanks for you reply, i know the means of chunk_sizes now. |
你好,我也遇到了这个问题,训练自己的数据集的时候,训练可以,但是测试就显存不足,请问怎么解决? |
可能是你的图片分辨率太大了,你可以把out of memory的那张图片的scale缩小一下
<https://maas.mail.163.com/dashi-web-extend/html/proSignature.html?ftlId=1&name=kaiwenduan&uid=kaiwenduan%40outlook.com&iconUrl=https%3A%2F%2Fmail-online.nosdn.127.net%2Fsm50fce5f4ba42e7ba632104ea76ed0e2d.jpg&items=%5B%22kaiwenduan%40outlook.com%22%5D>
[https://mail-online.nosdn.127.net/sm50fce5f4ba42e7ba632104ea76ed0e2d.jpg]
kaiwenduan
kaiwenduan@outlook.com
签名由 网易邮箱大师<https://mail.163.com/dashi/dlpro.html?from=mail81> 定制
On 11/15/2019 23:52,lzw0515<notifications@github.com><mailto:notifications@github.com> wrote:
@li10141110<https://github.com/li10141110> 你好,我训练ok,test出问题:
(CenterNet) [root@add CenterNet-master]# python test.py CenterNet-104 --testiter 12000 --split validation
cfg_file: config/CenterNet-104.json
loading all datasets...
split: minival
minival
{1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 13, 13: 14, 14: 15, 15: 16, 16: 17, 17: 18, 18: 19, 19: 20, 20: 21, 21: 22, 22: 23, 23: 24, 24: 25, 25: 27, 26: 28, 27: 31, 28: 32, 29: 33, 30: 34, 31: 35, 32: 36, 33: 37, 34: 38, 35: 39, 36: 40, 37: 41, 38: 42, 39: 43, 40: 44, 41: 46, 42: 47, 43: 48, 44: 49, 45: 50, 46: 51, 47: 52, 48: 53, 49: 54, 50: 55, 51: 56, 52: 57, 53: 58, 54: 59, 55: 60, 56: 61, 57: 62, 58: 63, 59: 64, 60: 65, 61: 67, 62: 70, 63: 72, 64: 73, 65: 74, 66: 75, 67: 76, 68: 77, 69: 78, 70: 79, 71: 80, 72: 81, 73: 82, 74: 84, 75: 85, 76: 86, 77: 87, 78: 88, 79: 89, 80: 90}
loading from cache file: cache/coco_val.pkl
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
<db.coco.MSCOCO object at 0x7f04291065c0>
system config...
{'batch_size': 2,
'cache_dir': 'cache',
'chunk_sizes': [2],
'config_dir': 'config',
'data_dir': '/data2/hejin/CenterNet-master/data',
'data_rng': <mtrand.RandomState object at 0x7f0460ec1ab0>,
'dataset': 'MSCOCO',
'decay_rate': 10,
'display': 5,
'learning_rate': 0.00025,
'max_iter': 12000,
'nnet_rng': <mtrand.RandomState object at 0x7f0460ec1af8>,
'opt_algo': 'adam',
'prefetch_size': 6,
'pretrain': None,
'result_dir': 'results',
'sampling_function': 'kp_detection',
'snapshot': 500,
'snapshot_name': 'CenterNet-104',
'stepsize': 5000,
'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': 3,
'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': False,
'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: 12000
building neural network...
module_file: models.CenterNet-104
total parameters: 209944226
loading parameters...
loading model from cache/nnet/CenterNet-104/CenterNet-104_12000.pkl
test.coco
<function testing at 0x7f0428af2158>
locating kps: 0%| | 0/10 [00:00<?, ?it/s]Traceback (most recent call last):
File "test.py", line 102, in
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 "/data2/hejin/CenterNet-master/test/coco.py", line 321, in testing
return globals()[system_configs.sampling_function](db, nnet, result_dir, debug=debug)
File "/data2/hejin/CenterNet-master/test/coco.py", line 129, in kp_detection
dets, center = decode_func(nnet, images, K, ae_threshold=ae_threshold, kernel=nms_kernel)
File "/data2/hejin/CenterNet-master/test/coco.py", line 54, in kp_decode
detections, center = nnet.test([images], ae_threshold=ae_threshold, K=K, kernel=kernel)
File "/data2/hejin/CenterNet-master/nnet/py_factory.py", line 114, in test
return self.model(*xs, **kwargs)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/data2/hejin/CenterNet-master/nnet/py_factory.py", line 32, in forward
return self.module(*xs, **kwargs)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/data2/hejin/CenterNet-master/models/py_utils/kp.py", line 290, in forward
return self._test(*xs, **kwargs)
File "/data2/hejin/CenterNet-master/models/py_utils/kp.py", line 243, in _test
inter = self.pre(image)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/data2/hejin/CenterNet-master/models/py_utils/utils.py", line 15, in forward
bn = self.bn(conv)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 66, in forward
exponential_average_factor, self.eps)
File "/data2/hejin/anaconda2/envs/CenterNet/lib/python3.6/site-packages/torch/nn/functional.py", line 1254, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: CUDA error: out of memory
你好,我也遇到了这个问题,训练自己的数据集的时候,训练可以,但是测试就显存不足,请问怎么解决?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#21?email_source=notifications&email_token=AHAQBSGCIOYX67CBYGDCMTDQT3ATVA5CNFSM4HKXRB42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEF3EOY#issuecomment-554414651>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHAQBSGCVBMF2AVW4POOZQTQT3ATVANCNFSM4HKXRB4Q>.
|
你好,请问一下,当我缩小图片的时候,运行test.py时会出现ValueError: need at least one array to concatenate,这个原因是np.concatenate(center_points, axis=1)中center_points是空集,可能原因是缩小图片会出现没有GT的情况,那我应该怎么解决这个问题?谢谢答疑 |
@yang-chenyu104 |
谢谢解答,我把scaless修改了,有个问题不懂,为啥要加一个scales==1的判断,把那行注释了#if scale == 1:目前正在生成results.json,谢谢大佬的代码,对我帮助很大!!!,想用中心点检测去做表格方面的研究,希望在自己研究方面加深!!!
…------------------ 原始邮件 ------------------
发件人: "Duankaiwen/CenterNet" ***@***.***>;
发送时间: 2021年5月28日(星期五) 下午3:42
***@***.***>;
抄送: "な法--言说 ***@***.******@***.***>;
主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21)
@yang-chenyu104
你修改scales的值了么?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@yang-chenyu104 |
谢谢解答,CenterNet检测框架对我帮助挺大的,谢谢大佬!!!
…------------------ 原始邮件 ------------------
发件人: "Duankaiwen/CenterNet" ***@***.***>;
发送时间: 2021年5月28日(星期五) 下午4:00
***@***.***>;
抄送: "な法--言说 ***@***.******@***.***>;
主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21)
谢谢解答,我把scaless修改了,有个问题不懂,为啥要加一个scales==1的判断,把那行注释了#if scale == 1:目前正在生成results.json,谢谢大佬的代码,对我帮助很大!!!,想用中心点检测去做表格方面的研究,希望在自己研究方面加深!!!
…
------------------ 原始邮件 ------------------ 发件人: "Duankaiwen/CenterNet" @.>; 发送时间: 2021年5月28日(星期五) 下午3:42 @.>; 抄送: "な法--言说 @.@.>; 主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21) @yang-chenyu104 你修改scales的值了么? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@yang-chenyu104
实验时发现只需要scale=1时检测到的center就够了,因此只取了scale=1时的center。希望对你有帮助。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
在代码里面我怎么去找寻效果最好的一次的损失和正确率
…------------------ 原始邮件 ------------------
发件人: "Duankaiwen/CenterNet" ***@***.***>;
发送时间: 2021年5月28日(星期五) 下午4:00
***@***.***>;
抄送: "な法--言说 ***@***.******@***.***>;
主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21)
谢谢解答,我把scaless修改了,有个问题不懂,为啥要加一个scales==1的判断,把那行注释了#if scale == 1:目前正在生成results.json,谢谢大佬的代码,对我帮助很大!!!,想用中心点检测去做表格方面的研究,希望在自己研究方面加深!!!
…
------------------ 原始邮件 ------------------ 发件人: "Duankaiwen/CenterNet" @.>; 发送时间: 2021年5月28日(星期五) 下午3:42 @.>; 抄送: "な法--言说 @.@.>; 主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21) @yang-chenyu104 你修改scales的值了么? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@yang-chenyu104
实验时发现只需要scale=1时检测到的center就够了,因此只取了scale=1时的center。希望对你有帮助。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
每次iter只有loss,等训练结束之后才统一测检测精度,所以没有办法去找效果最好的一次的正确率,你倒是可以找到1w,2w,..., 48w iter,这48个中最好的一次精度,因为每隔10000个iter会保存一次模型,比如你训练了480000 iters,那么你就有48个模型,加载每个模型测一下,找出最好的精度. 在trian.py line 138和line 154有每个iter之后的loss,你可以统计一下,找到最好的一次loss |
谢谢!!!会把这方面网络代码再好好学习!!!
…------------------ 原始邮件 ------------------
发件人: "Duankaiwen/CenterNet" ***@***.***>;
发送时间: 2021年5月28日(星期五) 下午4:25
***@***.***>;
抄送: "な法--言说 ***@***.******@***.***>;
主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21)
在代码里面我怎么去找寻效果最好的一次的损失和正确率
…
------------------ 原始邮件 ------------------ 发件人: "Duankaiwen/CenterNet" @.>; 发送时间: 2021年5月28日(星期五) 下午4:00 @.>; 抄送: "な法--言说 @.@.>; 主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21) 谢谢解答,我把scaless修改了,有个问题不懂,为啥要加一个scales==1的判断,把那行注释了#if scale == 1:目前正在生成results.json,谢谢大佬的代码,对我帮助很大!!!,想用中心点检测去做表格方面的研究,希望在自己研究方面加深!!! … ------------------ 原始邮件 ------------------ 发件人: "Duankaiwen/CenterNet" @.>; 发送时间: 2021年5月28日(星期五) 下午3:42 @.>; 抄送: "な法--言说 @.@.>; 主题: Re: [Duankaiwen/CenterNet] Testing this on my own dataset (#21) @yang-chenyu104 你修改scales的值了么? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. @yang-chenyu104 实验时发现只需要scale=1时检测到的center就够了,因此只取了scale=1时的center。希望对你有帮助。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@yang-chenyu104
每次iter只有loss,等训练结束之后才统一测检测精度,所以没有办法去找效果最好的一次的正确率,你倒是可以找到1w,2w,..., 48w iter,这48个中最好的一次精度,因为每隔10000个iter会保存一次模型,比如你训练了480000 iters,那么你就有48个模型,加载每个模型测一下,找出最好的精度.
在trian.py line 138和line 154有每个iter之后的loss,你可以统计一下,找到最好的一次loss
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
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 .
The text was updated successfully, but these errors were encountered: