Comments (2)
Hi, do you test it? can you tell me the result? Thank you
from yolov3_pytorch.
Maybe I think you could set
self.mse_loss = nn.MSELoss() self.bce_loss = nn.BCELoss()
to
self.mse_loss = nn.MSELoss(size_average=False) self.bce_loss = nn.BCELoss(size_average=False)
and then calculate losses like this way:
n_mask = torch.sum(mask) n_noobj_mask = torch.sum(noobj_mask) loss_x = self.bce_loss(x * mask, tx * mask) / n_mask loss_y = self.bce_loss(y * mask, ty * mask) / n_mask loss_w = self.mse_loss(w * mask, tw * mask) / n_mask loss_h = self.mse_loss(h * mask, th * mask) / n_mask loss_conf = self.bce_loss(conf * mask, 1.0 * mask) / n_mask + \ 0.5 * self.bce_loss(conf * noobj_mask, 0.0 * noobj_mask) / n_noobj_mask loss_cls = self.bce_loss(pred_cls[mask == 1], tcls[mask == 1]) / n_mask
I think maybe also add the condition when n_mask is zero:
if n_mask:
....
else:
loss_x = torch.zeros(1).cuda()
loss_y = torch.zeros(1).cuda()
loss_w = torch.zeros(1).cuda()
loss_h = torch.zeros(1).cuda()
loss_conf = self.lambda_conf * .5 * self.bce_loss(pred_conf * noobj_mask, noobj_mask * 0.) / n_noobj
loss_cls = torch.zeros(1).cuda()
from yolov3_pytorch.
Related Issues (20)
- KeepAspect() use
- the batch didn't slip when use muti-gpu HOT 1
- Is nms right?
- The implementation may be something wrong HOT 7
- CUDA out of memory, any tips? HOT 3
- How to train on my own dataset
- Hi,I have some problem in test the model?
- Hi,I have some problem to trained voc2007 dataset!!! HOT 7
- my dataset,why? HOT 1
- test
- 大佬您好,如何支持多卡训练? HOT 3
- Implementing different backbone to this YOLOv3 HOT 1
- 可以告诉我你训练的时间大概花了多久,和你用的什么型号的GPU吗?
- 大佬,我迁移了你的工程,loss也有下降,但是下降比较慢,而且训完比较多iter之后测试并没有结果,您能给我点意见吗?
- About the loss computation HOT 1
- why map is 34
- Is this YOLO uses darknet framework or cfg parser? HOT 2
- About basics of model HOT 1
- how to train on my datasets?
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 yolov3_pytorch.