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 ...
随机推荐
- Struts2 中EL表达式取值顺序
pagecontext---->request---->Valuestack-root栈顶----->root栈底----->actioncontext map----> ...
- sidePagination: "server"和responseHandler: responseHandler
bootstrapTable()中有两个属性 一个是sidePagination,表示服务器分页,responseHandler:responseHandler 表示回应操作的rows和total 两 ...
- 利用pl/sql developer进行远程连接oracle server出现的问题及解决办法
由于本人刚刚给自己的笔记本做了系统,由原来的32位系统编程现在的64位系统,所以,很多软件由于兼容性,不得不重新安装...当我安完了pl/sql developer工具后,就满心欢喜的去连接远程ora ...
- Git的环境搭建
Git时当下流行的分布式版本控制系统. 集中式版本控制系统的版本库是集中存放在中央处理器的,所以开发者要先从中央服务器获取最新的版本,编码后再将自己的代码发送给中央处理器.集中式版本控制系统最大的缺点 ...
- mysql的ERROR:1042
在虚拟机上测试数据库备份功能,需要连接外部机器上的mysql,pdo总是报超时错误! 起初认为是用的mysql账号的域不匹配!后来发现不是因为这个! 在终端中用mysql命令尝试连接,发现返回的错误是 ...
- HDU 4054
http://acm.hdu.edu.cn/showproblem.php?pid=4054 模拟题,对一个字符串的每个字符输出16进制表示的数字,每行处理16个字符,后面再把这16个字符输出,大小写 ...
- linux查看系统的启动时间和运行时间
1. uptime命令 输出:09:32:17 up 8:41, 1 user, load average: 0.01, 0.00, 0.00 其中8:41代表系统已经运行8小时41分 2.查看/pr ...
- JS中offsetLeft,Left,clientLeft的区别(纯转贴)
假设 obj 为某个 HTML 控件. obj.offsetTop 指 obj 相对于版面或由 offsetParent 属性指定的父坐标的计算上侧位置,整型,单位像素. obj.offsetLeft ...
- linux/lib/string.c
/** * strlen - Find the length of a string * @s: The string to be sized */ size_t strlen(const char ...
- (实用篇)php处理单文件、多文件上传代码分享
php处理 单文件.多文件上传实例代码,供大家参考,具体内容如下 后台处理文件submit_form_process.php <?php /************************** ...