windows10 + mobileNet-ssd

1. 下载MobileNet-SSD

https://github.com/eric612/MobileNet-SSD-windows。

2. 安装依赖环境:

CUDA 7.5 or 8.0 (use CUDA 8 if using Visual Studio 2015)
cuDNN v5

Visual Studio 2013 or 2015
CMake 3.4 or higher (Visual Studio and Ninja generators are supported)
Anaconda2 python2.7版本

3. 根据自己的配置更新编译文件build_win.cmd

if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14   # 如果使用VS2013,MSVC_VERSION全部设置为12
if NOT DEFINED WITH_NINJA set WITH_NINJA=0
if NOT DEFINED CPU_ONLY set CPU_ONLY=0    #  用gpu
if NOT DEFINED CUDA_ARCH_NAME set CUDA_ARCH_NAME=Auto
if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release
if NOT DEFINED USE_NCCL set USE_NCCL=0
if NOT DEFINED CMAKE_BUILD_SHARED_LIBS set CMAKE_BUILD_SHARED_LIBS=0
if NOT DEFINED PYTHON_VERSION set PYTHON_VERSION=2   # python版本为2.7
if NOT DEFINED BUILD_PYTHON set BUILD_PYTHON=1
if NOT DEFINED BUILD_PYTHON_LAYER set BUILD_PYTHON_LAYER=1
if NOT DEFINED BUILD_MATLAB set BUILD_MATLAB=0
if NOT DEFINED PYTHON_EXE set PYTHON_EXE=python
if NOT DEFINED RUN_TESTS set RUN_TESTS=1
if NOT DEFINED RUN_LINT set RUN_LINT=1
if NOT DEFINED RUN_INSTALL set RUN_INSTALL=1   # 设置为1
:: Set python 2.7 with conda as the default python
if !PYTHON_VERSION! EQU 2 (
    set CONDA_ROOT=E:\Anaconda2   # 路径
)
if !PYTHON_VERSION! EQU 3 (
    set CONDA_ROOT=E:\Anaconda2   # 路径
)
:: Build the install target
if NOT DEFINED RUN_INSTALL set RUN_INSTALL=1   # 设置为1

注解:如果编译报错,就删除script下的build目录,重新配置build_win.cmd&&重新打开cmd&&执行build_win.cmd。

这里常会出现报错:Could not find url for MSVC version = 1900 and Python version = 3.6. Call Stack (most recent call first): CMakeLists.txt:77 (include)
解决方案:将python2和python3的安装地址都设置成python2的地址就不会报错(我也是看到别人怎么做的,原因不明。)

4. 编译mobileNet ssd

cd $root_path/script
build_win.cmd
没有报错就代表成功,则在$root_path/script/build/install/bin里可以看到caffe.exe文件。

5.测试

Running Caffe
Download SSD_300x300 deploy model and save at

$caffe_root\models\VGGNet\VOC0712\SSD_300x300\

Download deploy weights from original web and save at

$caffe_root\models\MobileNet\

cd $caffe_root/
dectect.cmd

cd $caffe_root
python examples\ssd\test_ssd.py data\VOC0712\000166.jpg models\MobileNet\MobileNetSSD_deploy.prototxt models\MobileNet\MobileNet

你可能感兴趣的:(Deep_Learning)