caffe 报错 Check failed: error == cudaSuccess (74 vs. 0) misaligned address 解决办法
在caffe 源码中打开 caffe/src/caffe/layers/cudnn_conv_layer.cpp,添加如下框中所示:
size_t m=32;
max_workspace = (max_workspace+m-1)/m*m;
此外,在文件中找到如下for循环部分代码,在上述代码下面几行,添加else{},else范围如下所示
***else{***
// if we succeed in the allocation, set pointer aliases for workspaces
for (int g = 0; g < (this->group_ * CUDNN_STREAMS_PER_GROUP); g++) {
workspace[g] = reinterpret_cast<char *>(workspaceData) + g*max_workspace;
}
}
***}***
然后重新make all
参考:https://www.freesion.com/article/186134566/