caffe SSD 添加新层时出现的问题
来源:互联网 发布:数据库的逻辑设计 编辑:程序博客网 时间:2024/06/06 18:28
I0512 14:40:29.685868 15163 upgrade_proto.cpp:77] Attempting to upgrade batch norm layers using deprecated params: snapshot_iter_10000.caffemodel
I0512 14:40:29.685925 15163 upgrade_proto.cpp:80] Successfully upgraded batch norm layers using deprecated params.
I0512 14:40:29.710816 15163 sgd_solver.cpp:356] SGDSolver: restoring history
I0512 14:40:29.788755 15163 caffe.cpp:251] Starting Optimization
I0512 14:40:29.788800 15163 solver.cpp:294] Solving VGG_VOC0712_SSD_300x300_test_train
I0512 14:40:29.788805 15163 solver.cpp:295] Learning Rate Policy: multistep
I0512 14:40:29.799832 15163 solver.cpp:433] Iteration 10000, Testing net (#0)
I0512 14:40:29.817718 15163 net.cpp:693] Ignoring source layer mbox_loss
F0512 14:40:32.193830 15163 solver.cpp:464] Check failed: result[j]->width() == 5 (150 vs. 5)
*** Check failure stack trace: ***
@ 0x7f82cfdf75cd google::LogMessage::Fail()
@ 0x7f82cfdf9433 google::LogMessage::SendToLog()
@ 0x7f82cfdf715b google::LogMessage::Flush()
@ 0x7f82cfdf9e1e google::LogMessageFatal::~LogMessageFatal()
@ 0x7f82d04aef2c caffe::Solver<>::TestDetection()
@ 0x7f82d04afe39 caffe::Solver<>::TestAll()
@ 0x7f82d04aff3c caffe::Solver<>::Step()
@ 0x7f82d04b0abe caffe::Solver<>::Solve()
@ 0x40bcf4 train()
@ 0x4077c8 main
@ 0x7f82ce58e830 __libc_start_main
@ 0x408099 _start
@ (nil) (unknown)
Aborted (core dumped)
注:遇见问题,如果抛出错误,首先要去读源码。例如这个,要去solver.cpp中,看抛出的问题在什么地方。
看不懂代码也是悲伤!
SSD的solver源代码 为什么在test的时候,对每一次获得的blob 的width要和5进行对比呢?
*******************solver源代码分割线**********************
Dtype iter_loss;
const vector<Blob<Dtype>*>& result = test_net->Forward(&iter_loss);
if (param_.test_compute_loss()) {
loss += iter_loss;
}
for (int j = 0; j < result.size(); ++j) {
CHECK_EQ(result[j]->width(), 5);
const Dtype* result_vec = result[j]->cpu_data();
int num_det = result[j]->height();
for (int k = 0; k < num_det; ++k) {
int item_id = static_cast<int>(result_vec[k * 5]);
int label = static_cast<int>(result_vec[k * 5 + 1]);
if (item_id == -1) {
// Special row of storing number of positives for a label.
if (all_num_pos[j].find(label) == all_num_pos[j].end()) {
all_num_pos[j][label] = static_cast<int>(result_vec[k * 5 + 2]);
} else {
all_num_pos[j][label] += static_cast<int>(result_vec[k * 5 + 2]);
}
} else {
// Normal row storing detection status.
float score = result_vec[k * 5 + 2];
int tp = static_cast<int>(result_vec[k * 5 + 3]);
int fp = static_cast<int>(result_vec[k * 5 + 4]);
if (tp == 0 && fp == 0) {
// Ignore such case. It happens when a detection bbox is matched to
// a difficult gt bbox and we don't evaluate on difficult gt bbox.
continue;
}
all_true_pos[j][label].push_back(std::make_pair(score, tp));
all_false_pos[j][label].push_back(std::make_pair(score, fp));
}
}
}
}
***********************************2017/5/13*********************************
去git的主页上找到了一个人遇见了同样的问题,添加新的层会遇见同样的问题
原问题:
Thanks to Wei for the great work, and sharing it with everybody.
I need to get TEST loss during training, so that I can get some idea about how well the network is doing in generalization. In the python script I tried to add MultiBoxLoss layer to the test net the same way train net did, however it give me error at test time:
solver.cpp:464 check failed: result[j]->width() ==5 (1 vs 5)
I am not familiar with the internals of Caffe, could you give me a pointer on proper way of enabling test loss in the Python script?
Your help is greatly appreciated.
I think you have to add a silence layer after the loss layer.
在python的接口的代码
in the python script,when you create the test net, after CreateMultiBoxHead, add these lines
name = "test_loss"mbox_layers.append(net.label)net[name] = L.MultiBoxLoss(*mbox_layers, multibox_loss_param=multibox_loss_param, loss_param=loss_param, include=dict(phase=caffe_pb2.Phase.Value('TEST')), propagate_down=[True, True, False, False]) name="silence" net[name] = L.Silence(net['test_loss'],ntop=0)
also, add this to the solver_param:'test_compute_loss':True,
- caffe SSD 添加新层时出现的问题
- 使用caffe ssd中遇到的问题
- SSD(old)版本caffe安装在已安装新版本caffe的服务器,出现的问题及解决方案
- SSD编译的时候出现问题
- caffe SSD编译问题总结
- SSD编译出现问题
- caffe SSD环境搭建过程遇到的问题
- caffe ssd
- caffe ssd
- 【caffe-windows】在windows下编译caffe出现的问题
- 配置 Caffe 可能出现的问题
- caffe 转caffe2模型出现的问题
- windows-caffe ssd配置的一个坑
- SSD的caffe源码解读 -- 数据增强
- Mibilenet-SSD的Caffe系列实现
- 深度学习之caffe入门一一配置SSD中遇到的问题
- 关于caffe下ssd模型安装与测试的一点问题
- ubuntu caffe框架下测试ssd并添加跟踪代码
- LeetCode
- kafka安装
- webpack background-image css 显示不了
- 常用工具整理
- 浮动属性 position 与 float 细究
- caffe SSD 添加新层时出现的问题
- Max Sum of Rectangle No Larger Than K
- 1105. Spiral Matrix (25)[数组处理]
- C++各进制的输出
- 安装python第三方库最简单方便的方法-使用Anaconda
- 解决 mysql 存储过程查询数据方式是变量拼接表名的写法
- Java如何对一个数开方
- Linux的系统级性能剖析工具-perf
- 【搜索】洛谷 P1506 拯救oibh总部