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

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

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

  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. Xcode如何查看内存中的数据

    在  debug 模式下如何在断点处,查看字符指针变量内存中的值,像vs2008的调试工具一样的内存查看器,现在只能查看第一个内存中的值可以在输出窗口采用gdb命令:x /nfu <addr&g ...

  2. 捕获异常的两种方式Exception

    1.抛出异常:让调用此方法的代码去管 public static void GetFile() throws Exception{} package com.throwable; import jav ...

  3. CAD系统变量(参数)大全

    所谓系统变量就是一些参数,这些参数有些是可以在“选项”或其他对话框中进行设置的,有些这必须通过在命令行输入变量名进行设置,当然对于高手来说,还可以通过二次开发程序来进行控制. CAD有很多的变量,例如 ...

  4. Ubuntu 14.10 下安装MySQL

    在Ubuntu上安装MySQL很简单,只需要几个命令行 1 安装服务器 sudo apt-get install mysql-server 2 安装客户端 sudo apt-get install m ...

  5. hdu 2037

    PS:   - -原本想的是排序开始时间和消耗时间..后来想到可以排序结束时间..后来还wa了一次,因为排序的时候溢出了 思路: 1 3 //13 4 //20 7 3 8 2 9 5 10 //36 ...

  6. nosql(1)---radis

    Radis是一个key-value数据库,它会将key放入内存中,value放在硬盘上.  可以将数据持久化存储到磁盘. 内置的主从复制: master server和slave server之间有内 ...

  7. IOS网络开发概述

    概览 大部分应用程序都或多或少会牵扯到网络开发,例如说新浪微博.微信等,这些应用本身可能采用iOS开发,但是所有的数据支撑都是基于后台网络服务器的.如今,网络编程越来越普遍,孤立的应用通常是没有生命力 ...

  8. JS判断移动设备最佳方法 并实现跳转至手机版网页

    我在开发的Magento或Wordpress主题时,通过都会制作手机版本,为了实现某个片段在手机端和桌面端不同功能,又或者如果是手机设备,就跳转到指定的网页上,那么这里就需要用到JS来做判断了,下面有 ...

  9. OC多线程管理

    在OC中多线程管理包含GCD.NSThread.NSOperationQueue. 下面简单介绍. 进程和线程 进程:正在进行中的程序叫做进程,负责程序运行的内存分配. 每一个进程都有自己独立的虚拟内 ...

  10. WCF之服务说明

    实质:服务说明实质上就是服务相关的一些信息. 1.服务端代码添加了如下黄色代码: class Program { static void Main(string[] args) { //创建一个Ser ...