具体怎样配置caffe以及下载检测model网上有很多教程,这里只介绍如何修改代码使程序可以在CPU执行
定位到/caffe-ssd/examples/ssd/ssd_detect.py,修改如下
源代码
# Make sure that caffe is on the python path:
caffe_root = './'
改为(我把caffe-ssd文件夹放在了主目录home下)
# Make sure that caffe is on the python path:
# caffe_root = './'
caffe_root = '~/caffe-ssd'
注释掉以下代码
#caffe.set_device(gpu_id)
#caffe.set_mode_gpu()
在终端输入如下命令
<