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 ...
随机推荐
- 内部类中class声明地方不同,效果不一样
1.一个声明在类中,一个声明在类的方法中.在类中的方法中声明内部类,其方法中的内部类调用 内部类外中的变量,变量必须final class Outter{ int x1 = 0; public voi ...
- OBJECT ARX 添加标注样式
////获得当前图形的标注样式表 AcDbDimStyleTable* pDimStyleTbl; acdbHostApplicationServices()->workingDatabase( ...
- WPF如何实现类似iPhone界面切换的效果(转载)
WPF如何实现类似iPhone界面切换的效果 (version .1) 转自:http://blog.csdn.net/fallincloud/article/details/6968764 在论坛上 ...
- Note_Master-Detail Application(iOS template)_03_main.m
// main.m #import <UIKit/UIKit.h>//UIKitk框架提供一系列的Class(类)来建立和管理iPhone OS应用程序的用户界面( UI )接口.应用程序 ...
- linux上安装mysql
linux下mysql 最新版安装图解教程 1.查看当前安装的linux版本 命令:lsb_release -a 如下图所示 通过上图中的数据可以看出安装的版本为RedHat5.4,所以我们需要下载R ...
- 初见Gnuplot——时间序列的描述
研读一本书,<数据之魅:基于开源工具的数据分析>(Data Analysis with Open Source Tools),写的很好.这里,复述一下书中用Gnuplot分析时间序列数据的 ...
- [转]Golang Gob编码
Golang Gob编码 2012-08-24 09:47 by 轩脉刃, 5119 阅读, 1 评论, 收藏, 编辑 gob是Golang包自带的一个数据结构序列化的编码/解码工具.编码使用Enco ...
- 【OpenGL】法线变换详解(Normal Transform)[转]
http://blog.csdn.net/xiajun07061225/article/details/7762711 在图形学中,同样的一个模型视图变换矩阵可以用来变换点.线.多边形以及其它几何体, ...
- Dynamic Animator 、 CollectionViewLayout
1 给视图添加重力效果 1.1 问题 当给某个视图加上UIGravityBehavior重力行为之后,这个视图就具有重力,会如同掉入了无底洞,不断地下坠,不断的加速,本案例使用UIGravityBeh ...
- 我为什么要进国企----HP大中华区总裁孙振耀退休感言
一.关于工作与生活 我有个有趣的观察,外企公司多的是25-35岁的白领,40岁以上的员工很少,二三十岁的外企员工是意气风发的,但外企公司40岁附近的经理人是很尴尬的.我见过的40岁附近的外企经理人大多 ...