make runtest caffe::CPUDevice [ FAILED ]

转载自:https://blog.csdn.net/striker_v/article/details/51983173

编译caffe源码的大致过程如下: make all make pycaffe make test make runtest

小编在第N次搭建Caffe环境时,前面几步都很顺利,到最后一步make runtest这里出了问题。本来看着动漫等着make runtest运行完就去Happy,看到报错整个人都不好了。报错内容大致是这样的: [----------] Global test environment tear-down [==========] 906 tests from 133 test cases ran. (72964 ms total) [ PASSED ] 899 tests. [ FAILED ] 7 tests, listed below: [ FAILED ] SGDSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice [ FAILED ] AdaGradSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice [ FAILED ] NesterovSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice [ FAILED ] AdaDeltaSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice [ FAILED ] AdamSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice [ FAILED ] RMSPropSolverTest/0.TestSnapshot, where TypeParam = caffe::CPUDevice [ FAILED ] RMSPropSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice

废话已经说了不少,给大家提供三种解决方案。

1.如果提示: [ FAILED ] RMSPropSolverTest/0.TestSnapshotShare, where TypeParam = caffe::GPUDevice 注意,和上面不同,这里的报错信息里面显示的是“GPUDevice”而不是“CPUDevice”,这种情况可能是因为配置了多显卡环境,可以使用安装CUDA时运行./deviceQuery时标注的0号GPU("Device 0")跑跑测试试试看。

使用如下命令: export CUDA_VISIBLE_DEVICES=0 然后重新make runtest

2.当提示CPU错误时,如下: [ FAILED ] AdamSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice 如果使用了Intel MKL作为BLAS,可能是Intel MKL的浮点数计算功能没有设置正确。

使用如下命令: export MKL_CBWR=AUTO 然后重新make runtest

3.当提示CPU错误时,如下: [ FAILED ] AdamSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice 而且使用第二步中的命令完全不起作用时,建议使用Atlas替换Intel MKL。

Ubuntu中使用命令: sudo apt-get install libatlas-base-dev 安装Atlas。 修改Makefile.config, gedit Makefile.config 把 BLAS := mkl 改为 BLAS := atlas ,保存后退出。 重新编译make runtest即可。 另外,如果以上步骤都不起作用,可以试试换一个低版本的Boost库。目前明确Boost1.55.0木有问题。

注:网上有人这么说,但是我觉得这个报错和Boost版本木有关系,我一开始用Boost1.58.0,报错,换成Boost1.55.0,还是报错,换成最新的Boost1.61.0,依然报错。

猜你喜欢

转载自blog.csdn.net/cc13949459188/article/details/82828362