交流QQ:1187053210
deeplabv2安装问题总结如下:
1. cudnn从v5降级到v4,版本5在我的系统出现bug
2. atomicAdd的重写问题,cuda8已经有了atomicAdd函数的定义,出现bug。
解决方法:https://github.com/vlfeat/matconvnet/issues/575
具体做法:修改common.cuh
#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系列bug:
../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
具体做法:添加以下代码至cmake/Dependencies.cmake文件中
find_package(MATIO REQUIRED)
include_directories(${MATIO_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${MATIO_LIBRARIES})
并拷贝该findMatio文件到
cmake/Modules/文件夹中
文件下载路径:https://github.com/TheLegendAli/DeepLab-Context/files/453735/FindMATIO.cmake.zip