为了了解caffe与ROS是如何进行合作的,我查询了百度。在这篇csdn中,我明白了可以先去下一个ros_caffe运行一下。
在ros_caffe中git clone https://github.com/BVLC/caffe之后,我按照
cp Makefile.config.example Makefile.config
make all ; make install;make runtest
进行编译,下载model,成功之后(最好还是按照github上的Installation instructions来),但是运行出现如下的报错
E0131 23:20:44.034638 4585 common.cpp:114] Cannot create Cublas handle. Cublas won't be available.
E0131 23:20:44.053267 4585 common.cpp:121] Cannot create Curand generator. Curand won't be available.
F0131 23:20:44.053536 4585 syncedmem.hpp:22] Check failed: error == cudaSuccess (38 vs. 0) no CUDA-capable device is detected
当我去检查我的cuda和cudnn的时候
lspci | grep -i nvidia
>01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 950M] (rev a2)
nvcc -V
>nvcc: NVIDIA (R) Cuda compiler driver
>Copyright (c) 2005-2016 NVIDIA Corporation
>Built on Tue_Jan_10_13:22:03_CST_2017
>Cuda compilation tools, release 8.0, V8.0.61
lspci | grep -i nvidia
>01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 950M] (rev a2)
nvidia-smi
>NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
nvidia-smi显示链接不上显卡驱动了
按照此处:两种方法,后一种亲测有效。
roscore
rosrun ros_caffe ros_caffe_test
成功的结果
参考资料:
- https://stackoverflow.com/questions/36710865/caffe-installation
- https://blog.csdn.net/breeze5428/article/details/84073597(我在去掉之后再make还是一样,应该是显卡驱动的问题)
- https://www.cnblogs.com/mantha/p/11222530.html