C++ little errors , Big problem
------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------
Q1. compile caffe .cpp file , come out an error :
d302@d302-MS-7816-04:~/wangxiao/spl-caffe-master$ make -j8
NVCC src/caffe/layers/euclidean_loss_layer.cu
src/caffe/layers/euclidean_loss_layer.cu(43): error: a value of type "const float *" cannot be used to initialize an entity of type "float *"
detected during instantiation of "void caffe::EuclideanLossLayer<Dtype>::Backward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=float]"
(105): here
the original code is :
Dtype* diff_cpu_data = bottom[i]->mutable_cpu_diff();
const Dtype* label_data = bottom[]->cpu_data(); // label data: 0 or 1
const Dtype* predict_data = bottom[]->cpu_data(); // predict data int spl_num = ;
int al_num = ; for(int id = ; id < bottom[i]->count(); ++id) { // 35*12=420 // Self Paced Learning
if (label_data[id]==){
// negative samples ... do nothing
}
else{
if(predict_data[id]>0.7 && label_data[id]== ) {
spl_num ++ ;
// if the condition is met, transmit the gradient
// else make the gradient equal to zero...
}
else {
diff_cpu_data[id] = ;
// bottom[i]->mutable_cpu_diff()[id] = 0;
}
} // Active Learning
if (0.4 < predict_data[id] && predict_data[id] < 0.5){ if (label_data[id] == ){ predict_data[id] = ;
}else
if (label_data[id] == ){
predict_data[id] = ;
} al_num++; }
Solution 1: No solution, because the char* can not give to const char*, and the value of const char* can not be changed . and in my problem, we don't need change the predict score at all.
------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------
Q2. when trained a AlexNet caffe model, and use the Matlab Interface to extract Features or predicted Scores , However it tell me errors like the following :

d302@d302-MS-7816-04:~$ matlab
libprotobuf ERROR google/protobuf/text_format.cc:172] Error parsing text-format caffe.NetParameter: 339:2: Expected identifier.
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0116 15:34:34.112346 25564 upgrade_proto.cpp:928] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: ../../models/bvlc_alexnet/alex_hat_deploy.prototxt
*** Check failure stack trace: ***
Killed
Solution 2: layer 6 was repaired when I train my model , i.e.
layer {
name: "fc6_wx"
type: "InnerProduct"
bottom: "pool5"
top: "fc6_wx"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
inner_product_param {
num_output: 4096
weight_filler {
type: "gaussian"
std: 0.005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
change the name: "fc6_wx" into name: "fc6", and it will be OK .
------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------
C++ little errors , Big problem的更多相关文章
- linux下c程序调用reboot函数实现直接重启【转】
转自:http://www.blog.chinaunix.net/uid-20564848-id-73878.html linux下c程序调用reboot函数实现直接重启 当然你也可以直接调用syst ...
- [Hive - Tutorial] Querying and Inserting Data 查询和插入数据
Querying and Inserting Data Simple Query Partition Based Query Joins Aggregations Multi Table/File I ...
- AnsibleAPI源码剖析(1)-Runner类的 初始化
#ansible版本说明:ansible1.9.1 1.简单使用例子 # -*- coding=utf-8 -*- import ansible.runner #################### ...
- Understanding and Using HRMS Security in Oracle HRMS
Understanding and Using HRMS Security in Oracle HRMS Product:Oracle Human Resources Minimum Version: ...
- Linux Programmer's Manual --- reboot
REBOOT(2) Linux Programmer's Manual REBOOT(2) NAME reboot - reboot or enable/disable Ctrl-Alt-Del SY ...
- Hive Tutorial 阅读记录
Hive Tutorial 目录 Hive Tutorial 1.Concepts 1.1.What Is Hive 1.2.What Hive Is NOT 1.3.Getting Started ...
- How the problem solved about " Dealing with non-fast-forward errors"
Recently ,I got confused When I use git to push one of my project. The problem is below: And I Foun ...
- MyEclipse报错 Building workspace has encountered a problem Errors occurred during the build 的2种解决方法
1: Building workspace has encountered a problem Errors occurred during the build 如果报错这个 那么有可能是jar包,报 ...
- eclipse新建maven项目:'Building' has encountered a problem. Errors occurred during the build.
二.eclipse 新建maven 项目报错(因为没有配置maven环境) 1.问题: ① 出现的问题1: Could not calculate build plan:Plugin org.apac ...
随机推荐
- PHPSESSID的cookie
如果PHP脚本中有: 1 session_start(); 则说明使用了SESSION. SESSION是一种机制,可以在服务器端跨文件暂时保存数据或传递数据,常用于购物车等方面. SESSION只在 ...
- jQuery 自定义扩展,与$冲突处理
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 设置隐藏activity的标题栏
values->styles.xml中设置:stylename="AppTheme"parent="Theme.AppCompat.Light.NoActionBa ...
- zookeeper3.4.6的安装
最近为了解决HDFS的单点故障的问题,采用了HA的方式是实现,并通过zookeeper来实现自动切换,既然需自动切换的话,那么必须要安装zookeeper,我选用的版本是3.4.6.下面详细介绍一下其 ...
- 3D中的切线空间简介
转自:http://www.cnblogs.com/cxrs/archive/2009/10/25/1589515.html 1. 什么是Tangent space? Tangent space和wo ...
- 扩展jQuery easyui datagrid增加动态改变列编辑的类型
$.extend($.fn.datagrid.methods, { addEditor : function(jq, param) { if (param instanceof Array) { $. ...
- SVG 2D入门2 - 图形绘制
基本形状 SVG提供了很多的基本形状,这些元素可以直接使用,这一点比canvas好多了.废话不说了,直接看例子,这个最直接: <svg width="200" heigh ...
- javascript splice
//arrayObject.splice(index,howmany,element1,.....,elementX)//index 必需.规定从何处添加/删除元素.(0)//howmany 必需.规 ...
- VS调试Ajax
VS调试Ajax: 1.ashx在后台处理程序中设定断点 2.触发AJAX 3.F12打开浏览器调试,搜索找到ajax调用的JS,设置断点,在浏览器中单步调试,会自动进入后台处理程序,然后就可以调试后 ...
- 详解Java中的访问控制修饰符(public, protected, default, private)
Java中的访问控制修饰符已经困惑笔者多时,其中较复杂的情况一直不能理解透彻.今天下定决心,系统.全面地研究Java中的访问控制修饰符的所有方面,并整理成这篇文章,希望有同样疑惑的读者读完后能有所收获 ...