您的位置:首页 > Web前端

<caffe安装系列>deeplab-v2问题总结

2016-12-22 07:39 417 查看
deeplab-v2问题总结:

1. cudnn降级:由于v5出现函数不匹配,我就把v5降级到v4

2. atomicadd函数的修改:cuda8已经有该函数的定义,所以需要修改common.cuh文件

bug:caffe/common.cu error: function atomicadd has already been defined

解决方法:https://github.com/vlfeat/matconvnet/issues/575

具体做法:修改/include/caffe/common.cuh文件

具体代码如下:

// Copyright 2014 George Papandreou

#ifndef CAFFE_COMMON_CUH_

#define CAFFE_COMMON_CUH_

#include <cuda.h>

#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600

#else

// CUDA: atomicAdd is not defined for doubles

static __inline__ __device__ double atomicAdd(double *address, double val) {

  unsigned long long int* address_as_ull = (unsigned long long int*)address;

  unsigned long long int old = *address_as_ull, assumed;

  if (val==0.0)

    return __longlong_as_double(old);

  do {

    assumed = old;

    old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val +__longlong_as_double(assumed)));

  } while (assumed != old);

  return __longlong_as_double(old);

}

#endif

#endif

3. matio.h no such file or directory

解决办法: 安装libmatio,sudo apt-get install libmatio-dev 

4. 找不到mat系列文件

../lib/libcaffe.so.1.0.0-rc3: undefined
reference to 
Mat_VarCreate' ../lib/libcaffe.so.1.0.0-rc3: undefined reference to
Mat_CreateVer'
../lib/libcaffe.so.1.0.0-rc3: undefined reference to 
Mat_VarWrite'
../lib/libcaffe.so.1.0.0-rc3: undefined reference to
Mat_VarFree'
../lib/libcaffe.so.1.0.0-rc3: undefined reference to 
Mat_VarReadInfo'
../lib/libcaffe.so.1.0.0-rc3: undefined reference to
Mat_Close'
../lib/libcaffe.so.1.0.0-rc3: undefined reference to 
Mat_VarReadDataLinear'
../lib/libcaffe.so.1.0.0-rc3: undefined reference to
Mat_Open'

解决方法:https://github.com/TheLegendAli/DeepLab-Context2/issues/1

具体做法:

(1)添加以下代码至cmake/Dependencies.cmake文件中:

find_package(MATIO REQUIRED)
include_directories(${MATIO_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${MATIO_LIBRARIES})

(2)并将findmatio.cmake文件拷贝至文件夹cmake/Modules/

findmatio文件下载路径:https://github.com/TheLegendAli/DeepLab-Context/files/453735/FindMATIO.cmake.zip

交流qq:1187053210
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: