Comments (7)
是否用了ImageNet预训练权重?
不确定具体原因,我之后会Gitclone下来验证一下
from pytorch-yolo-v1.
@xiongzihua 默认是使用ImageNet预训练权重的吧。改成VGG_net作为backbone的话,有点效果了,五张图片可以检测出一个物品来吧_~_
from pytorch-yolo-v1.
@Bigwode 原因是这样的
box的中心点归一化到0-1之间,增加了框与框之间的距离导致计算IOU时普遍偏小.那么正类和背景的pred_iou就没什么区分度,所以区分不出前景背景,所以检测不到一个目标.
我觉得如果训练久一点,应该是可以训练出来(因为我之前应该训练过).
正确的处理方式:在yoloLoss.py中,对每一个框的中心点,cxcy/14.使框与框之间距离回到原始距离,计算出的IOU为正确IOU,同时增加contain_loss的权重为2,更注重正类这部分的损失.
以上改变其实在这个项目已经做了更正,不过忘记在这做了.
我的实验,改变后,训练四轮就能看出比较有效的结果了
from pytorch-yolo-v1.
@xiongzihua 可以的老哥,确实存在这个问题,我找了两天都没找到这个bug^_^。不过这个项目里面,你是除以了15.
from pytorch-yolo-v1.
@xiongzihua 老哥,我又有两个问题不太明白来请教你了,因为我看代码的过程中发现一个cell中的两个box对应的target都是一样的,对应的target_confidence也是一样的,那么这分开两个box训练的意义或者说两个box之间有什么关联?
第二个问题是,预测的cxcy是对应的pred_box的中心位置还是和cell的左上角的偏差呀?在求loss 的过程中是
box1_xyxy[:,:2] = box1[:,:2]/14. -0.5box1[:,2:4]
box1_xyxy[:,2:4] = box1[:,:2]/14. +0.5box1[:,2:4]
推测应该是中心位置,因为这里没有加上grid_cell的左上角的坐标,但是在predict.py中是加上了grid_cell的左上角的坐标的,两处感觉有点矛盾。
from pytorch-yolo-v1.
1.一个cell只预测一个目标,只有一个box是负责的,不好解决多余一个目标的情况。赋值一样训练时会根据iou决定哪一个负责,另一个当做负类。
2.cxcy是预测和cell左上角的偏差,在计算iou时,统一不加上cell坐标是因为不知道他是哪一个cell的,但是不影响中心点之间的距离,也不会影响iou计算
from pytorch-yolo-v1.
@xiongzihua
"正确的处理方式:在yoloLoss.py中,对每一个框的中心点,cxcy/14.使框与框之间距离回到原始距离,计算出的IOU为正确IOU,同时增加contain_loss的权重为2,更注重正类这部分的损失."
对这句话,能不能这么理解:
网络输出时,box的cxcy(中心点坐标)
是相对于匹配到的grid的,box的weight和height
是相对于整幅图片的,坐标含义不同.所以此时对cxcy除以14,使其坐标也相对整幅图,这样计算IOU才有意义.
from pytorch-yolo-v1.
Related Issues (20)
- eval error HOT 6
- about grid_num=14 HOT 2
- 您能提供一下预训练好的模型文件吗,谢谢! HOT 2
- 你的resnet50作为backbone时,输入(3,448,448)的图片,输出维度不是(7,7,30)! HOT 7
- yoloLoss的组成部分中contain_loss的可疑之处 HOT 1
- predict.py中的nms是对所有类别一起做nms吗?
- 执行eval_voc,Expected 4-dimensional input for 4-dimensional weight 64 3 7 7, but got 3-dimensional input of size [3, 448, 448] instead
- 这里操作是不是有问题? HOT 6
- predict.py error HOT 2
- Can't find the listfile.txt HOT 4
- About BatchNormalization HOT 1
- 损失函数的参数好像有点问题 HOT 4
- ImportError: cannot import name 'queue' from 'torch._six' (/home/liqi/.local/lib/python3.8/site-packages/torch/_six.py) HOT 5
- loss变化图片
- ValueError: Input must be >= 2-d. HOT 3
- 训练了 5 个epoch , pred bbox 的x2 竟然小于 x1 HOT 6
- best.pth
- IndexError: invalid index of a 0-dim tensor
- some pictures in annotation txt(voc2007.txt+ voc2012.txt) are not in the image folder(2007trainval + 2012trainval)
- 请问为什么要代码中加入了sigmoid? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-yolo-v1.