FCOS.Pytorch
FCOS.Pytorch copied to clipboard
VOC2007 train
Hi, I used your code training on the voc2007 train data which contains 5k images, and then run your demo finding the results is very bad. Could it be the lack of data sets that causes this failure? After all, I have a few computing resources.
sorry,the preprocessing of demo.py is for pre-trained model converted from official repo. You should uncomment some code in demo.py.
Yes, I have modified the demo.py to fit the VOC data set. Do you think it might be the lack of training sets?
You didn't provide any information. I couldn't help you. Training curve, demo output or something else.
Thank you for your reply. Now there are often problems with the remote connection of our school's server. Many of the results don't show up. I'm looking into it. Thank you very much. I'll discuss it with you when I have a good result.
Thank you for your reply. Now there are often problems with the remote connection of our school's server. Many of the results don't show up. I'm looking into it. Thank you very much. I'll discuss it with you when I have a good result.
You can refer to https://github.com/ChingHo97/FCOS-PyTorch-37.2AP I have fixed some bugs
Thank you for your reply. Now there are often problems with the remote connection of our school's server. Many of the results don't show up. I'm looking into it. Thank you very much. I'll discuss it with you when I have a good result.
You can refer to https://github.com/ChingHo97/FCOS-PyTorch-37.2AP I have fixed some bugs
Thanks for your work! Do you mind I add a link to your work into my README ? and I also would like you to indicate in README that you have referenced my code.
No problem. Really thank you for your repo, you can add the link , there are some bugs I fixed and I changed some hyperparameters.
------------------ 原始邮件 ------------------ 发件人: "xxxmy"<[email protected]>; 发送时间: 2020年6月28日(星期天) 晚上7:34 收件人: "VectXmy/FCOS.Pytorch"<[email protected]>; 抄送: "Cheney"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [VectXmy/FCOS.Pytorch] VOC2007 train (#8)
Thank you for your reply. Now there are often problems with the remote connection of our school's server. Many of the results don't show up. I'm looking into it. Thank you very much. I'll discuss it with you when I have a good result.
You can refer to https://github.com/ChingHo97/FCOS-PyTorch-37.2AP I have fixed some bugs
Thanks for your work! Do you mind I add a link to your work into my README ? and I also would like you to indicate in README that you have referenced my code.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
代码里面有些问题,我很疑惑。 1.cls_loss里面没有进行正样本筛选 pred_pos = preds[batch_index][mask[batch_index]] target_pos = target_pos[mask[batch_index]] 2.backbone里面的fc层之前的pooling是错误的,改为:self.avgpool = nn.AdaptiveAvgPool2d((1, 1)),当然目标检测没有用到 3.加载resnet预训练模型的时候,没有去掉top if pretrained: model_dict = model.state_dict() pretrained_dict = torch.load("./checkpoints/resnet50-19c8e357.pth") if not if_include_top: pretrained_dict = {k: v for k, v in pretrained_dict.items() if k in model_dict} # 将pretrained_dict里不属于model_dict的键剔除掉 # 以上作者错误 model.load_state_dict(pretrained_dict) # Unexpected key(s) in state_dict: "fc.weight", "fc.bias".因为网上预训练的resnet50没有去掉全连接层。
_gen_level_targets里面这些代码没有用到 # cnt_logits = cnt_logits.permute(0, 2, 3, 1) # cnt_logits = cnt_logits.reshape((batch_size, -1, 1)) # reg_preds = reg_preds.permute(0, 2, 3, 1) # reg_preds = reg_preds.reshape((batch_size, -1, 4)) # 把点数放中间
训练voc,cnt_loss不收敛,reg_loss到0.1左右也停了。
测试结果都是错误的
@zhengdq99 创建模型时没有fc层,也就不用管池化层。在resnet中将strict参数设为False即可。_gen_level_targets中那些可以注释掉。分类不需要进行正样本筛选。 不给出训练参数无从评价。可能原因:batch size太小,学习率太大等等。centerness在batch size较小时难以收敛。
if if_include_top:
self.fc = nn.Linear(512 * block.expansion, num_classes)
@zhengdq99 如果没看错的话,你才训练了一个epoch不到就说不收敛,还在warm up阶段-_-|||
训练了很多epoch,是从保存的模型中继续训练。
@zhengdq99 创建模型时没有fc层,也就不用管池化层。在resnet中将strict参数设为False即可。_gen_level_targets中那些可以注释掉。分类不需要进行正样本筛选。 不给出训练参数无从评价。可能原因:batch size太小,学习率太大等等。centerness在batch size较小时难以收敛。
if if_include_top: self.fc = nn.Linear(512 * block.expansion, num_classes)
非常感谢
我最近才买了深度学习工作站,回头按照您的参数进行训练。
@zhengdq99 您可以使用 https://github.com/ChingHo97/FCOS-PyTorch-37.2AP 这个仓库的代码,他fix了我的一些错误
好的,谢谢大佬指点。感激不尽。
在图像尺寸方面,我感觉fcos不需要严格按照图像原有的长宽比。 用opencv直接进行相同尺寸的缩放,不会影响结果吧?而且内存占用还少。 h_img, w_img, _ = image.shape h_in, w_in = input_ksize scale_h = h_in / h_img scale_w = w_in / w_img image_resized = cv2.resize(image, (w_in, h_in)) image_paded = np.zeros(shape=[h_in, w_in, 3], dtype=np.uint8) image_paded[:h_in, :w_in, :] = image_resized
@zhengdq99 不可以哦,直接resize,会导致物体形状完全变了,可能把一个东西拉的很长或很扁,跟实际测试相差很大
嗯,我回头做几组实验。
东强
------------------ Original ------------------ From: xxxmy <[email protected]> Date: Mon,Sep 21,2020 11:29 AM To: VectXmy/FCOS.Pytorch <[email protected]> Cc: zhengdq99 <[email protected]>, Mention <[email protected]> Subject: Re: [VectXmy/FCOS.Pytorch] VOC2007 train (#8)
@zhengdq99 不可以哦,直接resize,会导致物体形状完全变了,可能把一个东西拉的很长或很扁,跟实际测试相差很大
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.