------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------------------

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 :

  1. Dtype* diff_cpu_data = bottom[i]->mutable_cpu_diff();
  2. const Dtype* label_data = bottom[]->cpu_data(); // label data: 0 or 1
  3. const Dtype* predict_data = bottom[]->cpu_data(); // predict data
  4.  
  5. int spl_num = ;
  6. int al_num = ;
  7.  
  8. for(int id = ; id < bottom[i]->count(); ++id) { // 35*12=420
  9.  
  10. // Self Paced Learning
  11. if (label_data[id]==){
  12. // negative samples ... do nothing
  13. }
  14. else{
  15. if(predict_data[id]>0.7 && label_data[id]== ) {
  16. spl_num ++ ;
  17. // if the condition is met, transmit the gradient
  18. // else make the gradient equal to zero...
  19. }
  20. else {
  21. diff_cpu_data[id] = ;
  22. // bottom[i]->mutable_cpu_diff()[id] = 0;
  23. }
  24. }
  25.  
  26. // Active Learning
  27. if (0.4 < predict_data[id] && predict_data[id] < 0.5){
  28.  
  29. if (label_data[id] == ){
  30.  
  31. predict_data[id] = ;
  32. }else
  33. if (label_data[id] == ){
  34. predict_data[id] = ;
  35. }
  36.  
  37. al_num++;
  38.  
  39. }

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的更多相关文章

  1. linux下c程序调用reboot函数实现直接重启【转】

    转自:http://www.blog.chinaunix.net/uid-20564848-id-73878.html linux下c程序调用reboot函数实现直接重启 当然你也可以直接调用syst ...

  2. [Hive - Tutorial] Querying and Inserting Data 查询和插入数据

    Querying and Inserting Data Simple Query Partition Based Query Joins Aggregations Multi Table/File I ...

  3. AnsibleAPI源码剖析(1)-Runner类的 初始化

    #ansible版本说明:ansible1.9.1 1.简单使用例子 # -*- coding=utf-8 -*- import ansible.runner #################### ...

  4. Understanding and Using HRMS Security in Oracle HRMS

    Understanding and Using HRMS Security in Oracle HRMS Product:Oracle Human Resources Minimum Version: ...

  5. Linux Programmer's Manual --- reboot

    REBOOT(2) Linux Programmer's Manual REBOOT(2) NAME reboot - reboot or enable/disable Ctrl-Alt-Del SY ...

  6. Hive Tutorial 阅读记录

    Hive Tutorial 目录 Hive Tutorial 1.Concepts 1.1.What Is Hive 1.2.What Hive Is NOT 1.3.Getting Started ...

  7. 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 ...

  8. 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包,报 ...

  9. 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 ...

随机推荐

  1. php中的include()的使用技巧

    php中的include()的使用技巧 include() 语句包括并运行指定文件. 以下文档也适用于 require().这两种结构除了在如何处理失败之外完全一样.include() 产生一个警告而 ...

  2. 2013年8月份第4周51Aspx源码发布详情

    迷你桌面闹钟源码  2013-8-27 [VS2010]功能介绍:实现了定时闹钟的功能,可以设置闹钟最前端显示.感兴趣的可以下载学习. BR个人博客系统(课程设计)源码  2013-8-27 [VS2 ...

  3. 2016 -1 - 3 省市联动demo

    #import "ViewController.h" #import "CZProvinces.h" @interface ViewController ()& ...

  4. LeetCode 笔记系列 19 Scramble String [合理使用递归]

    题目: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty subs ...

  5. iOS开发之吸附动画效果

    步骤:1.使用singleviewapplication创建新的项目 2.在.h文件中创建两张图片的实例对象,并与相关的图片进行相连:创建一个UIDynamicAnimator实例对象 3.在.m文件 ...

  6. C++面向对象编程解决三阶矩阵相加减

    /*此处用面向对象编程*/ #include<iostream> #include<string.h> using namespace std; class Matrices ...

  7. PB常用日期

    用一条语句写成的有关日期函数 //1.生肖(年份参数:int ls_year  返回参数:string): mid(fill('鼠牛虎兔龙蛇马羊猴鸡狗猪',48),(mod(ls_year -1900 ...

  8. AmazeUI HTML元素

    按钮Button am-btn-xx(default.primary.secondary.success.warning.danger.link) am-radius 圆角按钮 am-round 椭圆 ...

  9. Finding Nemo_BFS

    Description Nemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, ...

  10. asp.net页面间传值的几种方法

    表单提交 传送页面代码 <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server ...