From dea3f31b1f671d37fa83a7d89ce5a599532ae8fc Mon Sep 17 00:00:00 2001 From: ximitiejiang Date: Wed, 4 Dec 2019 22:53:59 +0800 Subject: [PATCH] update --- demo/readme_base.md | 7 ++ ...ctor_retinanet_resnet50_voc.cpython-37.pyc | Bin 0 -> 2790 bytes .../cfg_detector_retinanet_resnet50_voc.py | 51 ++++----- .../test_detector_retinanet_voc.py | 61 ++++++++++ .../__pycache__/get_target_lib.cpython-37.pyc | Bin 7581 -> 7583 bytes model/__pycache__/loss_lib.cpython-37.pyc | Bin 5573 -> 5846 bytes .../__pycache__/retinanet_head.cpython-37.pyc | Bin 0 -> 5874 bytes .../__pycache__/ssd_head.cpython-37.pyc | Bin 12965 -> 13094 bytes model/bbox_head/retinanet_head.py | 106 ++++++++++-------- model/bbox_head/ssd_head.py | 14 ++- model/get_target_lib.py | 8 +- model/loss_lib.py | 17 ++- .../neck/__pycache__/neck_lib.cpython-37.pyc | Bin 7348 -> 7577 bytes model/neck/neck_lib.py | 8 +- .../prepare_training.cpython-37.pyc | Bin 15605 -> 15693 bytes utils/__pycache__/tools.cpython-37.pyc | Bin 13324 -> 14645 bytes utils/bbox_kmean.py | 6 +- utils/prepare_training.py | 2 + v01/model/__pycache__/losses.cpython-37.pyc | Bin 3467 -> 3479 bytes .../__pycache__/retina_head.cpython-37.pyc | Bin 8327 -> 8327 bytes v01/model/losses.py | 2 +- v01/model/retina_head.py | 10 +- .../__pycache__/anchor_target.cpython-37.pyc | Bin 16139 -> 16138 bytes v01/utils/anchor_target.py | 2 +- .../retinanet_voc/20191204_081458.log | 4 + .../retinanet_voc/20191204_100657.log | 2 + .../retinanet_voc/20191204_143156.log | 4 + .../retinanet_voc/20191204_143322.log | 2 + 28 files changed, 209 insertions(+), 97 deletions(-) create mode 100644 demo/retinanet_voc/__pycache__/cfg_detector_retinanet_resnet50_voc.cpython-37.pyc create mode 100644 demo/retinanet_voc/test_detector_retinanet_voc.py create mode 100644 model/bbox_head/__pycache__/retinanet_head.cpython-37.pyc create mode 100644 v01/work_dirs/retinanet_voc/20191204_081458.log create mode 100644 v01/work_dirs/retinanet_voc/20191204_100657.log create mode 100644 v01/work_dirs/retinanet_voc/20191204_143156.log create mode 100644 v01/work_dirs/retinanet_voc/20191204_143322.log diff --git a/demo/readme_base.md b/demo/readme_base.md index 51eeb54..ef6ccf3 100644 --- a/demo/readme_base.md +++ b/demo/readme_base.md @@ -509,6 +509,13 @@ 直到得到bbox正常的数据才return +### 训练中报错,binary_cross_entropy_with_logits(pred, target, weight)损失函数报错:RuntimeError: the derivative for 'weight' is not implemented + +1. 这个问题主要原因在于传入的weight是带有梯度反传标志的,但二值交叉熵公式并不支持对weight进行梯度反传更新。所以报错。 +实际上我并不需要weight进行梯度反传,之前的旧版本pytorch似乎不会报错,现在pytorch1.1爆出来反而是好事。 +解决方案:weight.detach()代替weight +参考:https://blog.csdn.net/sinat_24424445/article/details/101022092 + ### 训练中报错variable has been modified by an inplace operation: diff --git a/demo/retinanet_voc/__pycache__/cfg_detector_retinanet_resnet50_voc.cpython-37.pyc b/demo/retinanet_voc/__pycache__/cfg_detector_retinanet_resnet50_voc.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ddc24249fc419f9983283cfd728ea2da75f12a2 GIT binary patch literal 2790 zcmaJ?OOG4J5grbQik|m3NYivv0haQ&VcxlO2qC{&OmLD)-d(fO}4#zt$ z^fXu6J>`-k;dAm2bjvZh#wPNYFPktN>Lb(`lE=CUddWPIxJ)jF~HlkB!aV0qh>(Ha$*D<7)39 zsH1djTKO^3mKo-goudVx-pMJ`pT z7F6j)dWl}9GgPCqW2eyZ7^D`cL(8;+{Z(3{b68F2(q97_&SSkWb|3|sE{@Ftdu3b! zb!lw%jyzfeU8djRqz`Dp->>47kJImaOVIclRiI~yFVXsv0oYwK0u$@&1$9MJbah;% zH}KEVd*t85UZs=_D!Ver3a_5!HD1SQOu7bpe;7CDkBBE?2@U2$_nyGcb?mq3Pq?E$ z!=k>K6V$kA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gs_per_core, + batch_size=imgs_per_core, + num_workers=workers_per_core, pin_memory=False, # 数据送入GPU进行加速(默认False) drop_last=False, collate_fn='dict_collate', # 'default_collate','multi_collate', 'dict_collate' @@ -131,8 +139,8 @@ valloader = dict( params=dict( shuffle=False, - batch_size=gpus * imgs_per_core if gpus>0 else imgs_per_core, - num_workers=gpus * workers_per_core if gpus>0 else imgs_per_core, + batch_size=imgs_per_core, + num_workers=workers_per_core, pin_memory=False, # 数据送入GPU进行加速(默认False) drop_last=False, collate_fn='dict_collate', # 'default_collate','multi_collate', 'dict_collate' @@ -145,14 +153,3 @@ momentum=0.9, weight_decay=5e-4)) -loss_clf = dict( - type='cross_entropy', - params=dict( - reduction='mean' - )) - -loss_reg = dict( - type='smooth_l1', - params=dict( - reduction='mean' - )) diff --git a/demo/retinanet_voc/test_detector_retinanet_voc.py b/demo/retinanet_voc/test_detector_retinanet_voc.py new file mode 100644 index 0000000..5646f52 --- /dev/null +++ b/demo/retinanet_voc/test_detector_retinanet_voc.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Tue Sep 3 21:29:33 2019 + +@author: ubuntu +""" +import cv2 +from model.runner_lib import Runner +from utils.prepare_training import get_config +from utils.evaluation import eval_dataset_det, DetPredictor +from utils.tools import parse_log +from utils.dataset_classes import get_classes +from utils.visualization import vis_all_opencv, vis_all_pyplot, vis_cam + +def train_ssd(cfg_path, resume_from=None): + + runner = Runner(cfg, resume_from) + runner.train() + + + +if __name__ == "__main__": + + task = 'train' + cfg_path = './cfg_detector_retinanet_resnet50_voc.py' + cfg = get_config(cfg_path) + + if task == 'train': # 模型训练 + train_ssd(cfg, + resume_from=None) +# +# if task == 'log': +# parse_log(paths = ['/home/ubuntu/mytrain/ssd_vgg_voc/20191025_182352.log']) +# +# if task == 'eval': # 数据集评估 +# eval_dataset_det(cfg_path=cfg_path, +# load_from = '/home/ubuntu/mytrain/ssd_vgg_voc/epoch_11.pth', +# load_device='cuda') +# +# if task == 'load': # 已有数据集评估文件,重新载入进行评估 +# eval_dataset_det(cfg_path=cfg_path, +# load_from = '/home/ubuntu/mytrain/ssd_vgg_voc/epoch_11.pth', +# load_device='cuda', +# result_file='/home/ubuntu/mytrain/ssd_vgg_voc/20190928_084133_eval_result.pkl') +# +# if task == 'test': # 测试单张图或多张图的结果: cpu上0.649 sec, gpu上0.388 sec +# img = cv2.imread('/home/ubuntu/MyDatasets/misc/test13.jpg') +# predictor = DetPredictor(cfg_path, +# load_from = '/home/ubuntu/mytrain/ssd_vgg_voc/epoch_61.pth', +# load_device='cpu') +# for results in predictor([img]): +# vis_all_pyplot(*results, class_names=get_classes('voc'), score_thr=0.5) +# +# if task == 'video': # 测试视频预测结果:注意方法稍有不同,vis_cam需要传入一个predictor +# src = 0 # src可以等于int(cam_id), str(video path), list(img_list) +# predictor = DetPredictor(cfg_path, +# load_from = '/home/ubuntu/mytrain/ssd_vgg_voc/epoch_11.pth', +# load_device='cpu') +# vis_cam(src, predictor, class_names=get_classes('voc'), score_thr=0.2) +# \ No newline at end of file diff --git a/model/__pycache__/get_target_lib.cpython-37.pyc b/model/__pycache__/get_target_lib.cpython-37.pyc index 324cb84f389cffbf3d18d43969325e10f99c6cb4..b811cb3bd22d1411436e833b857157370fdc6002 100644 GIT binary patch delta 75 zcmbPhJ>QzwiIIU~L#u_!&YWb;DyOnzaZ Pg8a<95>yE}@kTZPTwNI2 diff --git a/model/__pycache__/loss_lib.cpython-37.pyc b/model/__pycache__/loss_lib.cpython-37.pyc index 865a2b2e2b3b354b6b86ae208e4d6a572201e601..c543646002ad563311e6a2a7a0368bde8656b842 100644 GIT binary patch delta 1990 zcmbtV-ESL35ci(%?DN?^I}S-45+IGp$JI%!pr#2Zv>{RvZK+?1NLAE^t3MJ;w$JR@ zN?TH;LRFgz0xg?<1R{|Le(CCCpV{MR1m%-SGpNMRhA946G zdo#Pw*M_W33ZVgXo5*l^GYs7UMihABu~QjNkR*55oX`_#>D-*VT|D<~_E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v;Uj4z5^D?Xxr%9u7_9`E~}0X{JaYO zKTBr2t}Rz>SG~Sy1hy4#lhW<`)$L&~#Ib#_LpLddJV9NJ3@Mk4_2 zDW{jjo3LtMyXQ;)Wc}Ot8J5>s>-_V0Rp);IFFEBw2o9;iWU{Pd!>#QWH|Vx4LKOsH ziM6_Mm?*>B?gr7ekB(_#Kk0o%H`2O=RZHh?Njvp!Ed=b3AJwDeLP9rmhxQmes(fl_ z^$JlEg_jsyz0zq2WNH}O~0(H^eCHBchggQlhAw5>XDEsVp=1iuZq5OItgSdXVkN_;hhF~L}fGa aNaw_@vnSMCCg%&f9Lzu5ds@{p6aNB4Ey$4o diff --git a/model/neck/neck_lib.py b/model/neck/neck_lib.py index 51942cb..45ead6b 100644 --- a/model/neck/neck_lib.py +++ b/model/neck/neck_lib.py @@ -9,7 +9,7 @@ import torch import torch.nn.functional as F from model.activation_lib import activation_dict -from utils.init_weights import common_init_weights +from utils.init_weights import common_init_weights, kaiming_init def conv_bn_relu(in_channels, out_channels, kernel_size, with_bn=False, activation='relu', with_maxpool=False, @@ -118,7 +118,11 @@ def forward(self, x): return tuple(outs) def init_weights(self): - common_init_weights(self) + """FPN初始化,mmdetection采用的是Xavier,但如果带了relu的话Xavier似乎不是最好选择,这里改成kaiming初始化""" + for m in self.modules(): + if isinstance(m, nn.Conv2d): + kaiming_init(m) +# common_init_weights(self) # %% diff --git a/utils/__pycache__/prepare_training.cpython-37.pyc b/utils/__pycache__/prepare_training.cpython-37.pyc index 3a2f3ff6d8433da2626c93c6fac186cf32ab1dfa..608657bdc31454777f502738d520772ad368a47c 100644 GIT binary patch delta 2759 zcmZuzYitzP72Z4h@OszY7+4u7#xG*K6TsMpUFIuE&{)~L3-owR$5wT4S;`OK)65H`=i5+4mUXRJ+V)&%-iUD5} z##qSQbMCxhBnGwTV5aZlo@3n<36PFM`b-Sun#v#FNe>JWmWS+=eF3xm~b*&d;f9 zcO2={eqTpF(|~UfRoE6Y)v1%5)Q>sNQN%jL1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XATM diff --git a/utils/__pycache__/tools.cpython-37.pyc b/utils/__pycache__/tools.cpython-37.pyc index 5b8793e12f8d7cfe7ae1e9e681668b50395ad17f..4f11b5496914fb3a3614b0ecd656645602e2ad73 100644 GIT binary patch delta 3654 zcmaJ@YitzP6`ngYJ3IUEVjB}|ip>J%v0#iJNg%vJ2mzWBA{Fiqf-C$->5%X8&{RcZ~nCB+`-1(N?m)- z+DfLUT398c=yp#JS8mEbK5>2q0aV49A zd6L$^yoRM;G(pI_#xXWO5t@W+K^6YXVv1YoC zu7{P(1tr_kM>o)optu4SWGh`*nQZ|@9Iq;@&bGq%71~BOfsr+|oo)unwQL>j7?v*) z{(VL!*3(Xq?ix@gNjAgcECWGoU>n(naRR#XVJWlC?;!`uGM+m86nG-=ybh21T_B^< zgfuCgmPX;^hjpHYIhm9ufhpYUyJzTs+}9JU2M=)AQ3e@0Mq7oSS+7?#%eTnTH?EOq`jy^6B*XOYt=P zOg`Xl6C<2?>GgeW=}h|3gI_+L{7v7ZukK7w`~eJr{`ADVGxxrJ^6-Po#g8gu4|TUT3m@4Q9FX2xLI@r-At1>?{xz)qU|H~ccO zK(!ouAW#bC@j%UctPn&wa|g{L3nC(hAhFMKOs|L8uEPVxVs;QY$+%+#x|=gSk8vZT z1jGw;+sHXqsbB{&;TFB#mUx}ySCqZw)Z7}ga}H(on1U1#Nz;i=YDtnbkQCvIVI_y# z!yo2LgGc1+C=5oWA;8D5?ACjLl5uhtGbDS;kUB{qLlIAzfDBDSHkU%4P7|0%K}V-b zxe1coFN2s&$tb8y#6m_Bh>uGB@{YOmJq15@sZcx-CU5@iAOG?0^o3tM`s)6|R6col z15UY)7-_VzGWXyo1dAh^&t_&Rc= zv#kUEP_S)2tB95GCo=wj*$4^HF8B7P)0Oi-sht09h^~&!otwL=90~^&;bRmw7^wXvJIB`oYr!!_^0v+ReqW31-Yi%fkiT(G2;ve8f+fyfH;kNVS%$IC zFGYUXjh=YhoOspN_!?lm43CQ$*ALl!3rT) zmHL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S_nykd>3=~P@jApc*e28ACrtDYuvl^2>`j zf$ECHfW+i>)*?pb$-h`@+2lcD3X_2h8D$_-lf8%=Bq9eQctHeI!49@iMzzU&?5i0y zChuaGW0aeGlRcWzV6rL44@S+&dYsNcks{7$Mw`j!I2S3}fQ({8H_8%Z9v_IXo;;Du zoY8LcNiJ_jAx)5CZY0Idlht?{7=tD+=g|>S0ZB3y8G>|4LD`d^^Y}=CTwA0DA`CzT P$i^Z&5D_%lm)8pb%_clz diff --git a/v01/model/__pycache__/retina_head.cpython-37.pyc b/v01/model/__pycache__/retina_head.cpython-37.pyc index 4f5e842ce5ed83b71e8d0ba97fc8e1af65830722..e2b296dda867a99e5ec03237c9ea29f8d1770d6b 100644 GIT binary patch delta 766 zcmYL{PiPZC6vi{@cFiAF)08zyX_E?-8bL*?(1RFLjQ`2WmR2KSvu^ET(hYBym{!3< z)wBg|>q9&UnpQ%< zKs>+oA6GxUQ;HHhhb3vmU6uYYl`EF+Xbq!m>sr;YAuEF1ZOf~S<=n%eCOdYX9I0Yz zc2A4`^B)^G!;u-l8$#Fa# zFEZ{vj+cTX3*_AOir_x!7HI{Jl0G89cjj%|0LQdu3jh{?gG1^tTf~cME~8V5s-Z%- zPM9G)Bs{=Pb)GG_dw0KQy-UI=W+ksDlxTYyeZ>Fz{6>H{7P0bpal(gH^X|t!hJ3ti=porGKOw z?K6Wa4F?h-L12UiF7*$pD?;+Fd9x17WZov+!jJt=?rhKSlFT-N&hx*=3!!+lR&7+v zm5S9g?9Rg0Eiotf7eVQ13d$XOlNOPh))YURmzyFZ>{#_1WpnnL&1JtCHSHo6+oqlyOBu{L zhjz{fg^Nr#MN~wPy-4uE7ykgCd=MW3!kz{H0w46Aq--I4^1a{tJ?9>hG%}5hGNvfu z7IE!6RGCeGQnC`9WE>LEk8n({2 z!e3y@S&xiMFwM8x({RaY@2~-~{6XhX7o#>E0$M-}W7-BX{=IWjzD+*zz0s6>p5z5S z5zT_`Jd4f*1{cV=>lNW5>3gIVJWl$UfV(@xn2C1Ls*EFA;^zJ804(uy>S*d3rKlQb z33)<+&>%eIAJutSaQ5%{3|;qylhq`zCtjxQW&S4?gH_%ZeLKR};^L)B>0w zr`y+${oTIA2(0j2;y}`id+zoG?k+UF4}{nG`^4zL3#wTca6?tJsunX!4CB;KLa)+4 z(us5z11b%N5+OzaLX|)2=~GvPbX(_(Ra_>sM!3Vj_N*=L%$bfDUXn`>0C)2f&a`k!mj`T diff --git a/v01/model/losses.py b/v01/model/losses.py index a071353..4358b44 100644 --- a/v01/model/losses.py +++ b/v01/model/losses.py @@ -46,7 +46,7 @@ def sigmoid_focal_loss(pred, weight = (alpha * target + (1 - alpha) * (1 - target)) * weight weight = weight * pt.pow(gamma) return F.binary_cross_entropy_with_logits( - pred, target, weight, reduction=reduction) + pred, target, weight.detach(), reduction=reduction) # 注意:二值交叉熵公式禁止传入的weight带有梯度反传标志,所以必须让weight先detach才行。 def weighted_sigmoid_focal_loss(pred, diff --git a/v01/model/retina_head.py b/v01/model/retina_head.py index 9f39e19..1a43b4e 100644 --- a/v01/model/retina_head.py +++ b/v01/model/retina_head.py @@ -149,15 +149,15 @@ def get_anchors(self, featmap_sizes, img_metas): def loss_single(self, cls_score, bbox_pred, labels, label_weights, bbox_targets, bbox_weights, num_total_samples, cfg): - # classification loss + """""" if self.use_sigmoid_cls: - labels = labels.reshape(-1, self.cls_out_channels) - label_weights = label_weights.reshape(-1, self.cls_out_channels) + labels = labels.reshape(-1, self.cls_out_channels) # (4, 151200, 20)->(604800, 20) + label_weights = label_weights.reshape(-1, self.cls_out_channels) # (4, 151200, 20)->(604800, 20) else: labels = labels.reshape(-1) label_weights = label_weights.reshape(-1) cls_score = cls_score.permute(0, 2, 3, 1).reshape( - -1, self.cls_out_channels) + -1, self.cls_out_channels) # (4, 9*20, h, w) -> (4*9*h*w, 20)=(604800, 20) if self.use_sigmoid_cls: if self.use_focal_loss: cls_criterion = weighted_sigmoid_focal_loss @@ -216,7 +216,7 @@ def loss(self, cls_scores, bbox_preds, gt_bboxes, gt_labels, img_metas, (labels_list, label_weights_list, bbox_targets_list, bbox_weights_list, num_total_pos, num_total_neg) = cls_reg_targets num_total_samples = (num_total_pos if self.use_focal_loss else - num_total_pos + num_total_neg) + num_total_pos + num_total_neg) # retinanet只取正样本 losses_cls, losses_reg = multi_apply( self.loss_single, cls_scores, diff --git a/v01/utils/__pycache__/anchor_target.cpython-37.pyc b/v01/utils/__pycache__/anchor_target.cpython-37.pyc index 50551927ebeac36ba5575bb3bdc8b7b4986ad2fc..e6315ad0ae39bbc2429dad53cc44849a0d5e6282 100644 GIT binary patch delta 2642 zcmZ`*U2IfE6lS`+x7+P*cgvQRwp6yIwA~g2T8fmP3Mi-n5oip-1g^Kcx3^cfdzZO) zDWFm?V*HEI3{f8pQjtG-FuD&$66L`JjDXRI4~#zvgan@yO!P?;=Q|gnG_uWpojG&n z%$#$+b7o)N^U9v8Rk2uPiu#HQRUm_|z1x)Gyg8~56>~XWPr{s& zxA=5%KCwk>fNG=Ys;*BqW0-NJTb?V$=IX9lGH!6|j^pB%r{5tEN2*hC8HLPt zin^W8s=XJhQ*4I#v$~|U!}1JKXq_(3Ox?nIMJl;s-Xc0lS%Nn2gG#4@bcn|=#xh?G z@Rvk$Tb($X{7mmqGO1AS$rnI>E?^C`0vW@*ZNm?PlQ&)8IGq;o zPfJ0)!ZmY4VrAnr@qNwGX)9r772p9t0v%Y#(Tx(sr4mm+6YTL z3cdA!#{e5jS8HEqV|1}@2<}xNgE`yvWLdr-Lk8!@F8&atnsOrRjL33#xHvSFGgTh4 z{xYR4GQ^z`U8Sb5i+q%2oQ^U31yP6;$C)?pqV&_1qukmPL45>>q zUIS4RpbUZA0VHIO|{L9*j}|cq_w-nnO9ma#e6W9kh{&i80X& zj?0%rGY+w9DC=ex(n)%G(~?2RlS!aYPQs9 zJe3R~U`g?7ON)4?r7OnOEM4XYgVtF_Tx}^mLCLD1j7(q*k!472nUJ(BrWVXp{BKNs z@<3@2Ff4A&YGs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CZ@36RA& zRxxHhqri8(Bz-lYsp&NbS`Z$`#ABOLyC& zA>aXm4GyywE6_ql>&J+wMN2Qalv_^&iPZGcoM;ut<(tS{ZGhO-$vbrgNtfB#M#+yr zo*_%4q*W^wgKINR)h_UT;&w;%k!8di!x_LnKjC`1XU>)lZ_X*m8p&v7MEoGAxps=| z&eNZZ7L2h-WCe@YCmLh%Sc*^8zUfRdwo`V}A6=zpS;l1zyH`Bly}L`J-T6?ElKWZh z7e9B`R9V1!S*0Z`k_38|94sm10X$B_Y5jfk91sdd`v9uAvo6ODisszr-2Y``dFZW& zX=j2_=$OK>aD>Ie_~nPi+1wfFe6lCoqSjLlG}EOK7?3R(IO6l3d=!&` z&d{^EE!covlA)3mk|Qc*@ujq6za*s&n;CJXw~e)nuY2=0RG~kh}Nt2cYT@&-CZI)s+FuG|U!1F*D;FyURPy z%AOd4h^e*>B~0Vjny(#1B5 z6C*p)YEp86hNQGo#jTMa*#+_G!+-Tk*Bq`CojR486#ULBzT#2Z4UfM|kE*!2X+1k5 zQk&PZGqnddCqivK(&}mX!;AF5W!4$bi9MrR76c>?pahr$n1CoimL7cOsQ;2#7=OXw z#9GTdVg%hK?>bq&drXzdc^MmZKmjmI;Kvc=ykVB+!XEDv$t@Fy7pI&bGs`87MvKn> zox-IlgOh}5yJo=%h9Q3y&I7VxWdX_nn?My8w`|x5YWPW6gy7{~FeqiK`)Qm>Qa8va zeU8M&y4h(lIOY((GxkG=KRQb@)8nUv81H9S#V6xgw`bFH{x{}qzpIg@wwm$ma9&kd^AUIS7k1)*F@ei^72=D>m zGJzUJMdpHk^ZXj*unwRBt4ks^(aJ7~{)xUMi0Vg!&w;1J!HLe%A(%`7B$Y610?J8l XT)^WQz-a(d$7_H~G@9sBa$?)x?ctLZ diff --git a/v01/utils/anchor_target.py b/v01/utils/anchor_target.py index 9096b0f..b5bc79b 100644 --- a/v01/utils/anchor_target.py +++ b/v01/utils/anchor_target.py @@ -538,7 +538,7 @@ def expand_binary_labels(labels, label_weights, label_channels): inds = torch.nonzero(labels >= 1).squeeze() if inds.numel() > 0: bin_labels[inds, labels[inds] - 1] = 1 # 注意这里需要把原始标签(1-20)转换到0-19,因为独热编码需要从0开始 - bin_label_weights = label_weights.view(-1, 1).expand( + bin_label_weights = label_weights.view(-1, 1).expand( # (201600)->(201600, 20),相当于把第一列复制20份 label_weights.size(0), label_channels) return bin_labels, bin_label_weights diff --git a/v01/work_dirs/retinanet_voc/20191204_081458.log b/v01/work_dirs/retinanet_voc/20191204_081458.log new file mode 100644 index 0000000..f336075 --- /dev/null +++ b/v01/work_dirs/retinanet_voc/20191204_081458.log @@ -0,0 +1,4 @@ +2019-12-04 08:14:58,809 - INFO - Start running, host: ubuntu@ubun, work_dir: /home/ubuntu/suliang_git/deep_learning_algorithm/v01/work_dirs/retinanet_voc +2019-12-04 08:14:58,810 - INFO - workflow: [('train', 1)], max: 20 epochs +2019-12-04 10:06:57,961 - INFO - Start running, host: ubuntu@ubun, work_dir: /home/ubuntu/suliang_git/deep_learning_algorithm/v01/work_dirs/retinanet_voc +2019-12-04 10:06:57,961 - INFO - workflow: [('train', 1)], max: 20 epochs diff --git a/v01/work_dirs/retinanet_voc/20191204_100657.log b/v01/work_dirs/retinanet_voc/20191204_100657.log new file mode 100644 index 0000000..6b69ae1 --- /dev/null +++ b/v01/work_dirs/retinanet_voc/20191204_100657.log @@ -0,0 +1,2 @@ +2019-12-04 10:06:57,961 - INFO - Start running, host: ubuntu@ubun, work_dir: /home/ubuntu/suliang_git/deep_learning_algorithm/v01/work_dirs/retinanet_voc +2019-12-04 10:06:57,961 - INFO - workflow: [('train', 1)], max: 20 epochs diff --git a/v01/work_dirs/retinanet_voc/20191204_143156.log b/v01/work_dirs/retinanet_voc/20191204_143156.log new file mode 100644 index 0000000..9c05007 --- /dev/null +++ b/v01/work_dirs/retinanet_voc/20191204_143156.log @@ -0,0 +1,4 @@ +2019-12-04 14:31:56,745 - INFO - Start running, host: ubuntu@ubun, work_dir: /home/ubuntu/suliang_git/deep_learning_algorithm/v01/work_dirs/retinanet_voc +2019-12-04 14:31:56,746 - INFO - workflow: [('train', 1)], max: 20 epochs +2019-12-04 14:33:22,857 - INFO - Start running, host: ubuntu@ubun, work_dir: /home/ubuntu/suliang_git/deep_learning_algorithm/v01/work_dirs/retinanet_voc +2019-12-04 14:33:22,858 - INFO - workflow: [('train', 1)], max: 20 epochs diff --git a/v01/work_dirs/retinanet_voc/20191204_143322.log b/v01/work_dirs/retinanet_voc/20191204_143322.log new file mode 100644 index 0000000..da01405 --- /dev/null +++ b/v01/work_dirs/retinanet_voc/20191204_143322.log @@ -0,0 +1,2 @@ +2019-12-04 14:33:22,857 - INFO - Start running, host: ubuntu@ubun, work_dir: /home/ubuntu/suliang_git/deep_learning_algorithm/v01/work_dirs/retinanet_voc +2019-12-04 14:33:22,858 - INFO - workflow: [('train', 1)], max: 20 epochs