Skip to content

Commit 0e162e5

Browse files
authored
Merge pull request weiliu89#1 from weiliu89/ssd
Ssd
2 parents 7812885 + 8cd3970 commit 0e162e5

55 files changed

Lines changed: 647 additions & 103 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ env:
2828
- BUILD_NAME="cudnn-cmake" WITH_CMAKE=true WITH_CUDA=true WITH_CUDNN=true
2929

3030
cache:
31-
timeout: 604800 # 1 week
3231
apt: true
3332
directories:
3433
- ~/protobuf3

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,11 @@ else
382382
LIBRARIES += cblas
383383
# 10.10 has accelerate while 10.9 has veclib
384384
XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep 'version' | sed 's/[^0-9]*\([0-9]\).*/\1/')
385+
XCODE_CLT_GEQ_7 := $(shell [ $(XCODE_CLT_VER) -gt 6 ] && echo 1)
385386
XCODE_CLT_GEQ_6 := $(shell [ $(XCODE_CLT_VER) -gt 5 ] && echo 1)
386-
ifeq ($(XCODE_CLT_GEQ_6), 1)
387+
ifeq ($(XCODE_CLT_GEQ_7), 1)
388+
BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers
389+
else ifeq ($(XCODE_CLT_GEQ_6), 1)
387390
BLAS_INCLUDE ?= /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
388391
LDFLAGS += -framework Accelerate
389392
else

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# SSD: Single Shot MultiBox Detector
22

3-
By [Wei Liu](http://www.cs.unc.edu/~wliu/), [Dragomir Anguelov](http://research.google.com/pubs/DragomirAnguelov.html), [Dumitru Erhan](http://research.google.com/pubs/DumitruErhan.html), [Christian Szegedy](http://research.google.com/pubs/ChristianSzegedy.html), [Scott Reed](http://www-personal.umich.edu/~reedscot/), Cheng-Yang Fu, [Alexander C. Berg](http://acberg.com).
3+
[![Build Status](https://travis-ci.org/weiliu89/caffe.svg?branch=ssd)](https://travis-ci.org/weiliu89/caffe)
4+
5+
By [Wei Liu](http://www.cs.unc.edu/~wliu/), [Dragomir Anguelov](https://www.linkedin.com/in/dragomiranguelov), [Dumitru Erhan](http://research.google.com/pubs/DumitruErhan.html), [Christian Szegedy](http://research.google.com/pubs/ChristianSzegedy.html), [Scott Reed](http://www-personal.umich.edu/~reedscot/), [Cheng-Yang Fu](http://www.cs.unc.edu/~cyfu/), [Alexander C. Berg](http://acberg.com).
46

57
### Introduction
68

cmake/Cuda.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,18 @@ function(detect_cuDNN)
174174
PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDA_TOOLKIT_INCLUDE}
175175
DOC "Path to cuDNN include directory." )
176176

177-
get_filename_component(__libpath_hist ${CUDA_CUDART_LIBRARY} PATH)
178-
find_library(CUDNN_LIBRARY NAMES libcudnn.so # libcudnn_static.a
179-
PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDNN_INCLUDE} ${__libpath_hist}
180-
DOC "Path to cuDNN library.")
177+
# dynamic libs have different suffix in mac and linux
178+
if(APPLE)
179+
set(CUDNN_LIB_NAME "libcudnn.dylib")
180+
else()
181+
set(CUDNN_LIB_NAME "libcudnn.so")
182+
endif()
181183

184+
get_filename_component(__libpath_hist ${CUDA_CUDART_LIBRARY} PATH)
185+
find_library(CUDNN_LIBRARY NAMES ${CUDNN_LIB_NAME}
186+
PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDNN_INCLUDE} ${__libpath_hist} ${__libpath_hist}/../lib
187+
DOC "Path to cuDNN library.")
188+
182189
if(CUDNN_INCLUDE AND CUDNN_LIBRARY)
183190
set(HAVE_CUDNN TRUE PARENT_SCOPE)
184191
set(CUDNN_FOUND TRUE PARENT_SCOPE)

cmake/Dependencies.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ include(cmake/ProtoBuf.cmake)
2626
# ---[ HDF5
2727
find_package(HDF5 COMPONENTS HL REQUIRED)
2828
include_directories(SYSTEM ${HDF5_INCLUDE_DIRS} ${HDF5_HL_INCLUDE_DIR})
29-
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES})
29+
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
3030

3131
# ---[ LMDB
3232
if(USE_LMDB)
@@ -102,6 +102,12 @@ elseif(APPLE)
102102
find_package(vecLib REQUIRED)
103103
include_directories(SYSTEM ${vecLib_INCLUDE_DIR})
104104
list(APPEND Caffe_LINKER_LIBS ${vecLib_LINKER_LIBS})
105+
106+
if(VECLIB_FOUND)
107+
if(NOT vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
108+
add_definitions(-DUSE_ACCELERATE)
109+
endif()
110+
endif()
105111
endif()
106112

107113
# ---[ Python

cmake/Modules/FindAtlas.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ set(Atlas_LIB_SEARCH_PATHS
2626
find_path(Atlas_CBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Atlas_INCLUDE_SEARCH_PATHS})
2727
find_path(Atlas_CLAPACK_INCLUDE_DIR NAMES clapack.h PATHS ${Atlas_INCLUDE_SEARCH_PATHS})
2828

29-
find_library(Atlas_CBLAS_LIBRARY NAMES ptcblas_r ptcblas cblas_r cblas PATHS ${Atlas_LIB_SEARCH_PATHS})
30-
find_library(Atlas_BLAS_LIBRARY NAMES atlas_r atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
31-
find_library(Atlas_LAPACK_LIBRARY NAMES alapack_r alapack lapack_atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
29+
find_library(Atlas_CBLAS_LIBRARY NAMES ptcblas_r ptcblas cblas_r cblas PATHS ${Atlas_LIB_SEARCH_PATHS})
30+
find_library(Atlas_BLAS_LIBRARY NAMES atlas_r atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
31+
find_library(Atlas_LAPACK_LIBRARY NAMES lapack alapack_r alapack lapack_atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
3232

3333
set(LOOKED_FOR
3434
Atlas_CBLAS_INCLUDE_DIR

cmake/Modules/FindvecLib.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ set(__veclib_include_suffix "Frameworks/vecLib.framework/Versions/Current/Header
1414

1515
find_path(vecLib_INCLUDE_DIR vecLib.h
1616
DOC "vecLib include directory"
17-
PATHS /System/Library/${__veclib_include_suffix}
18-
/System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
19-
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/)
17+
PATHS /System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
18+
/System/Library/${__veclib_include_suffix}
19+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
20+
NO_DEFAULT_PATH)
2021

2122
include(FindPackageHandleStandardArgs)
2223
find_package_handle_standard_args(vecLib DEFAULT_MSG vecLib_INCLUDE_DIR)

data/cifar10/get_cifar10.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This scripts downloads the CIFAR10 (binary version) data and unzips it.
33

44
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
5-
cd $DIR
5+
cd "$DIR"
66

77
echo "Downloading..."
88

data/ilsvrc12/get_ilsvrc_aux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - the training splits with labels
99

1010
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
11-
cd $DIR
11+
cd "$DIR"
1212

1313
echo "Downloading..."
1414

data/mnist/get_mnist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This scripts downloads the mnist data and unzips it.
33

44
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
5-
cd $DIR
5+
cd "$DIR"
66

77
echo "Downloading..."
88

0 commit comments

Comments
 (0)