-
Notifications
You must be signed in to change notification settings - Fork 134
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
The question about the different between darknet-yolo2 and caffe-yolo9000 #8
Comments
|
Thank you! |
|
Thanks you for reply! 1.Could you show the details of the problem which results in low mAP, if you convenience, or share the code in github?
Thank you! |
Details are all in the original repository. But I have to delete it for some reasons. I haven't add the reorg layer. I would tell you if I get a high mAP with reorg layer next week. |
Do you add reorg layer and get a high mAP? |
@chengshuai @choasup |
I do not get the high mAP. you should check the train data(the data and label are wrong) |
@choasup |
Hello, thank you for the code caffe-yolo9000, i have some question:
question 1: why multiply -1.0 in the region_layer_loss.cpp(caffe-yolo9000), but no multiply the -1.0 in the region_layer.c(darknet-yolo2),for example,
the file region_layer.c in the darknet-yolo2:
float delta_region_box(box truth, float x, float biases, int n, int index, int i, int j, int w, int h, float delta, float scale)
{
box pred = get_region_box(x, biases, n, index, i, j, w, h);
float iou = box_iou(pred, truth);
//????????
float tx = (truth.xw - i);
float ty = (truth.yh - j);
float tw = log(truth.ww / biases[2n]);
float th = log(truth.hh / biases[2*n + 1]);
}
and in forward_region_layer,for example,
l.delta[index + 4] = l.noobject_scale * ((0 - l.output[index + 4]) * logistic_gradient(l.output[index + 4]));
l.delta[best_index + 4] = l.object_scale * (1 - l.output[best_index + 4]) * logistic_gradient(l.output[best_index + 4]);//
the file region_loss_layer.c in the caffe-yolo9000:
Dtype delta_region_box(vector truth, Dtype* x, vector biases, int n, int index, int i, int j, int w, int h, Dtype* delta, float scale){
vector pred;
pred.clear();
pred = get_region_box(x, biases, n, index, i, j, w, h);
float iou = Calc_iou(pred, truth);
//LOG(INFO) << pred[0] << "," << pred[1] << "," << pred[2] << "," << pred[3] << ";"<< truth[0] << "," << truth[1] << "," << truth[2] << "," << truth[3];
float tx = truth[0] * w - i; //0.5
float ty = truth[1] * h - j; //0.5
float tw = log(truth[2] * w / biases[2n]); //truth[2]=biases/w tw = 0
float th = log(truth[3] * h / biases[2n + 1]); //th = 0
delta[index + 0] =# (-1.0) * scale * (tx - sigmoid(x[index + 0])) * sigmoid(x[index + 0]) * (1 - sigmoid(x[index + 0]));
delta[index + 1] =# (-1.0) * scale * (ty - sigmoid(x[index + 1])) * sigmoid(x[index + 1]) * (1 - sigmoid(x[index + 1]));
delta[index + 2] =# (-1.0) * scale * (tw - x[index + 2]);
delta[index + 3] =# (-1.0) * scale * (th - x[index + 3]);
return iou;
}
and loss function in the RegionLossLayer::Forward_cpu,for example,
diff[index + 4] = # (-1.0) * noobject_scale_ * (0 - swap_data[index + 4]) * (swap_data[index + 4]) * (1 - swap_data[index + 4]);
diff[best_index + 4] = # (-1.0) * object_scale_ * (1 - swap_data[best_index + 4]) * (swap_data[best_index + 4] * (1 - swap_data[best_index + 4]));
why do you multiply the coefficient -1.0?
question 2:
Do you add the reorg layer in the network? when add the reorg_layer, the train process is not convergence.
The text was updated successfully, but these errors were encountered: