Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
42cf87d
triplet data generation and network update
wangyida Jun 4, 2015
3d7cf65
New triplet loss layer added(beta1 version-no test source files)
wangyida Jun 7, 2015
f23813f
triplet data generation and network update
wangyida Jun 4, 2015
083f61b
New triplet loss layer added(beta1 version-no test source files)
wangyida Jun 7, 2015
9b571fa
macro define in upgrade_proto
wangyida Jun 15, 2015
011aef0
restore
wangyida Jun 15, 2015
fbcab79
suit for opencv3.0.0
wangyida Jun 15, 2015
d92b0d4
delete spaces
wangyida Jun 15, 2015
d45672c
delete libopenccodecsv
wangyida Jun 15, 2015
b825d33
triplet tranining data code fix
wangyida Jun 15, 2015
273d375
cpu only
wangyida Jun 15, 2015
da1e177
cpu only
wangyida Jun 15, 2015
454323d
cpu only
wangyida Jun 15, 2015
04145dd
bug fixes on triplet_loss_layer.cpp and the test on mnist works well
wangyida Jun 16, 2015
17a0fd7
GPU version added
wangyida Jun 16, 2015
e7e1a03
opencv 2.4x
wangyida Jun 16, 2015
48402b0
annangement of headers
wangyida Jun 16, 2015
9e10e17
parameter update in triplet
wangyida Jun 17, 2015
66e80a7
master restore
wangyida Jun 30, 2015
00f2537
lfw test added in examples of triplet
wangyida Jun 30, 2015
455c96b
delete unuseful codes
wangyida Jul 2, 2015
15e09ce
Pair wise part combined with Triplrt training
wangyida Jul 6, 2015
9fbee51
add feature extraction codes in samples
wangyida Jul 13, 2015
4a351a3
add 3d network training param
wangyida Jul 15, 2015
02bae98
ready for a review on triplet training using the 3D data, net work de…
wangyida Jul 24, 2015
050b57f
delete spaces
wangyida Jul 24, 2015
1f6c87a
rewrite the prototxt for 3d model training
wangyida Jul 29, 2015
2546736
add pose information for training data arrangement in triplet training
wangyida Jul 30, 2015
8842528
delete macro
wangyida Jul 30, 2015
bbb3664
add the codes wrongly deteted...
wangyida Jul 30, 2015
0e9273c
rearrange the training samples selection codes
wangyida Jul 31, 2015
a327b5c
remove static_cast<int> declare
wangyida Jul 31, 2015
3fa4ba2
modify the data generation condition
wangyida Aug 1, 2015
03e16df
the soft style triplet loss as added in triplet loss layer as an option
wangyida Aug 2, 2015
8dcf4a4
Caffe gtest on triplet, GPU codes, modification on training data crea…
wangyida Aug 4, 2015
14add46
No sclice layer version which could forward a set of triplets togethe…
wangyida Aug 9, 2015
c3f89b8
delete file
wangyida Aug 10, 2015
d78cf52
add gpu codes for triplet loss
wangyida Aug 10, 2015
05549e4
add initiate class name of triplet loss layer
wangyida Aug 10, 2015
7c13cda
add initiate class name of triplet loss layer
wangyida Aug 10, 2015
f6d25b5
debug GPU triplet loss codes for loss type 0
wangyida Aug 12, 2015
2799398
closest sample fix
wangyida Aug 13, 2015
0ace83d
bug fixes for the newest triplet loss, now it could be used by settin…
wangyida Aug 15, 2015
0f4cead
add RGB data training as an option in triplet training
wangyida Aug 16, 2015
053c784
format fix
wangyida Aug 18, 2015
5391c69
Merge branch 'cnn_triplet' of https://github.com/Wangyida/caffe
wangyida Aug 18, 2015
5cc33da
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 3, 2015
818db53
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 12, 2015
6c5f31d
standard master
wangyida Sep 12, 2015
9a40f05
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 15, 2015
eab220e
local master update
wangyida Sep 17, 2015
4a86ec1
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 17, 2015
1a2b93f
rebase
wangyida Sep 17, 2015
3d24b43
update master branch by clone upstream and push again
wangyida Sep 18, 2015
be87d80
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 18, 2015
4083fbb
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 21, 2015
8ae27d5
Merge branch 'master' of https://github.com/BVLC/caffe
wangyida Sep 22, 2015
b907e95
triplet data generation and network update
wangyida Jun 4, 2015
1274161
triplet data generation and network update
wangyida Jun 4, 2015
99302ed
suit for opencv3.0.0
wangyida Jun 15, 2015
57b18fd
lfw test added in examples of triplet
wangyida Jun 30, 2015
cedc70b
ready for a review on triplet training using the 3D data, net work de…
wangyida Jul 24, 2015
551de67
add pose information for training data arrangement in triplet training
wangyida Jul 30, 2015
b8fb519
rearrange the training samples selection codes
wangyida Jul 31, 2015
451a136
No sclice layer version which could forward a set of triplets togethe…
wangyida Aug 9, 2015
d0c3f24
add initiate class name of triplet loss layer
wangyida Aug 10, 2015
9dcb7fc
New triplet loss layer added(beta1 version-no test source files)
wangyida Jun 7, 2015
0e83e82
macro define in upgrade_proto
wangyida Jun 15, 2015
898ce4c
suit for opencv3.0.0
wangyida Jun 15, 2015
0553e2e
cpu only
wangyida Jun 15, 2015
e93feb5
lfw test added in examples of triplet
wangyida Jun 30, 2015
98f595e
ready for a review on triplet training using the 3D data, net work de…
wangyida Jul 24, 2015
db14ebf
add pose information for training data arrangement in triplet training
wangyida Jul 30, 2015
9245f64
No sclice layer version which could forward a set of triplets togethe…
wangyida Aug 9, 2015
4d0104b
add initiate class name of triplet loss layer
wangyida Aug 10, 2015
a0204f0
debug GPU triplet loss codes for loss type 0
wangyida Aug 12, 2015
6af9038
add RGB data training as an option in triplet training
wangyida Aug 16, 2015
e98d8e5
triplet data generation and network update
wangyida Jun 4, 2015
9f2d6af
GPU version added
wangyida Jun 16, 2015
93b9bfa
lfw test added in examples of triplet
wangyida Jun 30, 2015
ed4e477
add 3d network training param
wangyida Jul 15, 2015
53e1a28
add pose information for training data arrangement in triplet training
wangyida Jul 30, 2015
bc4f4af
rearrange the training samples selection codes
wangyida Jul 31, 2015
704886b
the soft style triplet loss as added in triplet loss layer as an option
wangyida Aug 2, 2015
f23f7a4
No sclice layer version which could forward a set of triplets togethe…
wangyida Aug 9, 2015
2a560f5
add initiate class name of triplet loss layer
wangyida Aug 10, 2015
2abe774
new data and new feature dimension
wangyida Aug 19, 2015
54f81cc
update triplet data generation codes for RGB using
wangyida Aug 28, 2015
12b3bd9
add 2 more class in data generation and set the dimension of feature …
wangyida Aug 29, 2015
c6787cd
delete orig files
wangyida Sep 22, 2015
48fdb08
restore
wangyida Sep 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ include(cmake/ConfigGen.cmake)

# ---[ Options
caffe_option(CPU_ONLY "Build Caffe without CUDA support" OFF) # TODO: rename to USE_CUDA
caffe_option(USE_CUDNN "Build Caffe with cuDNN library support" ON IF NOT CPU_ONLY)
caffe_option(USE_CUDNN "Build Caffe with cuDNN libary support" ON IF NOT CPU_ONLY)
caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
caffe_option(BUILD_python "Build Python wrapper" ON)
set(python_version "2" CACHE STRING "Specify which Python version to use")
set(python_version "2" CACHE STRING "Specify which python version to use")
caffe_option(BUILD_matlab "Build Matlab wrapper" OFF IF UNIX OR APPLE)
caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)
caffe_option(BUILD_python_layer "Build the Caffe Python layer" ON)
caffe_option(USE_LMDB "Build with lmdb" ON)
caffe_option(USE_LEVELDB "Build with levelDB" ON)
caffe_option(USE_OPENCV "Build with OpenCV support" ON)
caffe_option(BUILD_python_layer "Build the Caffe python layer" ON)

# ---[ Dependencies
include(cmake/Dependencies.cmake)
Expand Down
38 changes: 6 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,9 @@ ifneq ($(CPU_ONLY), 1)
LIBRARY_DIRS += $(CUDA_LIB_DIR)
LIBRARIES := cudart cublas curand
endif

LIBRARIES += glog gflags protobuf boost_system m hdf5_hl hdf5

# handle IO dependencies
USE_LEVELDB ?= 1
USE_LMDB ?= 1
USE_OPENCV ?= 1

ifeq ($(USE_LEVELDB), 1)
LIBRARIES += leveldb snappy
endif
ifeq ($(USE_LMDB), 1)
LIBRARIES += lmdb
endif
ifeq ($(USE_OPENCV), 1)
LIBRARIES += opencv_core opencv_highgui opencv_imgproc
endif
LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc #opencv_imgcodecs
PYTHON_LIBRARIES := boost_python python2.7
WARNINGS := -Wall -Wno-sign-compare

Expand Down Expand Up @@ -304,17 +290,6 @@ ifeq ($(USE_CUDNN), 1)
COMMON_FLAGS += -DUSE_CUDNN
endif

# configure IO libraries
ifeq ($(USE_OPENCV), 1)
COMMON_FLAGS += -DUSE_OPENCV
endif
ifeq ($(USE_LEVELDB), 1)
COMMON_FLAGS += -DUSE_LEVELDB
endif
ifeq ($(USE_LMDB), 1)
COMMON_FLAGS += -DUSE_LMDB
endif

# CPU-only configuration
ifeq ($(CPU_ONLY), 1)
OBJS := $(PROTO_OBJS) $(CXX_OBJS)
Expand Down Expand Up @@ -354,9 +329,8 @@ else
# OS X packages atlas as the vecLib framework
LIBRARIES += cblas
# 10.10 has accelerate while 10.9 has veclib
XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep 'version' | sed 's/[^0-9]*\([0-9]\).*/\1/')
XCODE_CLT_GEQ_6 := $(shell [ $(XCODE_CLT_VER) -gt 5 ] && echo 1)
ifeq ($(XCODE_CLT_GEQ_6), 1)
XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep -o 'version: 6')
ifneq (,$(findstring version: 6,$(XCODE_CLT_VER)))
BLAS_INCLUDE ?= /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
LDFLAGS += -framework Accelerate
else
Expand Down Expand Up @@ -498,7 +472,7 @@ runtest: $(TEST_ALL_BIN)

pytest: py
cd python; python -m unittest discover -s caffe/test

mattest: mat
cd matlab; $(MATLAB_DIR)/bin/matlab -nodisplay -r 'caffe.run_tests(), exit()'

Expand Down
5 changes: 0 additions & 5 deletions Makefile.config.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_LEVELDB := 0
# USE_LMDB := 0
# USE_OPENCV := 0

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
Expand Down
12 changes: 0 additions & 12 deletions cmake/ConfigGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@ function(caffe_generate_export_configs)
list(APPEND Caffe_DEFINITIONS -DCPU_ONLY)
endif()

if(USE_OPENCV)
list(APPEND Caffe_DEFINITIONS -DUSE_OPENCV)
endif()

if(USE_LMDB)
list(APPEND Caffe_DEFINITIONS -DUSE_LMDB)
endif()

if(USE_LEVELDB)
list(APPEND Caffe_DEFINITIONS -DUSE_LEVELDB)
endif()

if(NOT HAVE_CUDNN)
set(HAVE_CUDNN FALSE)
else()
Expand Down
41 changes: 15 additions & 26 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,19 @@ include_directories(SYSTEM ${HDF5_INCLUDE_DIRS} ${HDF5_HL_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES})

# ---[ LMDB
if(USE_LMDB)
find_package(LMDB REQUIRED)
include_directories(SYSTEM ${LMDB_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${LMDB_LIBRARIES})
add_definitions(-DUSE_LMDB)
endif()
find_package(LMDB REQUIRED)
include_directories(SYSTEM ${LMDB_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${LMDB_LIBRARIES})

# ---[ LevelDB
if(USE_LEVELDB)
find_package(LevelDB REQUIRED)
include_directories(SYSTEM ${LevelDB_INCLUDE})
list(APPEND Caffe_LINKER_LIBS ${LevelDB_LIBRARIES})
add_definitions(-DUSE_LEVELDB)
endif()
find_package(LevelDB REQUIRED)
include_directories(SYSTEM ${LevelDB_INCLUDE})
list(APPEND Caffe_LINKER_LIBS ${LevelDB_LIBRARIES})

# ---[ Snappy
if(USE_LEVELDB)
find_package(Snappy REQUIRED)
include_directories(SYSTEM ${Snappy_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${Snappy_LIBRARIES})
endif()
find_package(Snappy REQUIRED)
include_directories(SYSTEM ${Snappy_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${Snappy_LIBRARIES})

# ---[ CUDA
include(cmake/Cuda.cmake)
Expand All @@ -65,16 +57,13 @@ if(NOT HAVE_CUDA)
endif()

# ---[ OpenCV
if(USE_OPENCV)
find_package(OpenCV QUIET COMPONENTS core highgui imgproc imgcodecs)
if(NOT OpenCV_FOUND) # if not OpenCV 3.x, then imgcodecs are not found
find_package(OpenCV REQUIRED COMPONENTS core highgui imgproc)
endif()
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
list(APPEND Caffe_LINKER_LIBS ${OpenCV_LIBS})
message(STATUS "OpenCV found (${OpenCV_CONFIG_PATH})")
add_definitions(-DUSE_OPENCV)
find_package(OpenCV QUIET COMPONENTS core highgui imgproc imgcodecs)
if(NOT OpenCV_FOUND) # if not OpenCV 3.x, then imgcodecs are not found
find_package(OpenCV REQUIRED COMPONENTS core highgui imgproc)
endif()
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
list(APPEND Caffe_LINKER_LIBS ${OpenCV_LIBS})
message(STATUS "OpenCV found (${OpenCV_CONFIG_PATH})")

# ---[ BLAS
if(NOT APPLE)
Expand Down
18 changes: 5 additions & 13 deletions cmake/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,17 @@ function(caffe_print_configuration_summary)
caffe_status(" BUILD_matlab : ${BUILD_matlab}")
caffe_status(" BUILD_docs : ${BUILD_docs}")
caffe_status(" CPU_ONLY : ${CPU_ONLY}")
caffe_status(" USE_LMDB : ${USE_LMDB}")
caffe_status(" USE_LEVELDB : ${USE_LEVELDB}")
caffe_status(" USE_OPENCV : ${USE_OPENCV}")
caffe_status("")
caffe_status("Dependencies:")
caffe_status(" BLAS : " APPLE THEN "Yes (vecLib)" ELSE "Yes (${BLAS})")
caffe_status(" Boost : Yes (ver. ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION})")
caffe_status(" glog : Yes")
caffe_status(" gflags : Yes")
caffe_status(" protobuf : " PROTOBUF_FOUND THEN "Yes (ver. ${PROTOBUF_VERSION})" ELSE "No" )
if(USE_LMDB)
caffe_status(" lmdb : " LMDB_FOUND THEN "Yes (ver. ${LMDB_VERSION})" ELSE "No")
endif()
if(USE_LEVELDB)
caffe_status(" LevelDB : " LEVELDB_FOUND THEN "Yes (ver. ${LEVELDB_VERSION})" ELSE "No")
caffe_status(" Snappy : " SNAPPY_FOUND THEN "Yes (ver. ${Snappy_VERSION})" ELSE "No" )
endif()
if(USE_OPENCV)
caffe_status(" OpenCV : Yes (ver. ${OpenCV_VERSION})")
endif()
caffe_status(" lmdb : " LMDB_FOUND THEN "Yes (ver. ${LMDB_VERSION})" ELSE "No")
caffe_status(" Snappy : " SNAPPY_FOUND THEN "Yes (ver. ${Snappy_VERSION})" ELSE "No" )
caffe_status(" LevelDB : " LEVELDB_FOUND THEN "Yes (ver. ${LEVELDB_VERSION})" ELSE "No")
caffe_status(" OpenCV : Yes (ver. ${OpenCV_VERSION})")
caffe_status(" CUDA : " HAVE_CUDA THEN "Yes (ver. ${CUDA_VERSION})" ELSE "No" )
caffe_status("")
if(HAVE_CUDA)
Expand Down Expand Up @@ -174,3 +165,4 @@ function(caffe_print_configuration_summary)
caffe_status(" Install path : ${CMAKE_INSTALL_PREFIX}")
caffe_status("")
endfunction()

26 changes: 12 additions & 14 deletions cmake/Templates/CaffeConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@
# Caffe_HAVE_CUDNN - signals about cuDNN support


# OpenCV dependency (optional)
# OpenCV dependency

if(@USE_OPENCV@)
if(NOT OpenCV_FOUND)
set(Caffe_OpenCV_CONFIG_PATH "@OpenCV_CONFIG_PATH@")
if(Caffe_OpenCV_CONFIG_PATH)
get_filename_component(Caffe_OpenCV_CONFIG_PATH ${Caffe_OpenCV_CONFIG_PATH} ABSOLUTE)
if(NOT OpenCV_FOUND)
set(Caffe_OpenCV_CONFIG_PATH "@OpenCV_CONFIG_PATH@")
if(Caffe_OpenCV_CONFIG_PATH)
get_filename_component(Caffe_OpenCV_CONFIG_PATH ${Caffe_OpenCV_CONFIG_PATH} ABSOLUTE)

if(EXISTS ${Caffe_OpenCV_CONFIG_PATH} AND NOT TARGET opencv_core)
message(STATUS "Caffe: using OpenCV config from ${Caffe_OpenCV_CONFIG_PATH}")
include(${Caffe_OpenCV_CONFIG_PATH}/OpenCVModules.cmake)
endif()

else()
find_package(OpenCV REQUIRED)
if(EXISTS ${Caffe_OpenCV_CONFIG_PATH} AND NOT TARGET opencv_core)
message(STATUS "Caffe: using OpenCV config from ${Caffe_OpenCV_CONFIG_PATH}")
include(${Caffe_OpenCV_CONFIG_PATH}/OpenCVModules.cmake)
endif()
unset(Caffe_OpenCV_CONFIG_PATH)

else()
find_package(OpenCV REQUIRED)
endif()
unset(Caffe_OpenCV_CONFIG_PATH)
endif()

# Compute paths
Expand Down
5 changes: 0 additions & 5 deletions cmake/Templates/caffe_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@

/* Matlab */
#cmakedefine HAVE_MATLAB

/* IO libraries */
#cmakedefine USE_OPENCV
#cmakedefine USE_LMDB
#cmakedefine USE_LEVELDB
9 changes: 3 additions & 6 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ When updating Caffe, it's best to `make clean` before re-compiling.

## Prerequisites

Caffe has several dependencies:
Caffe has several dependencies.

* [CUDA](https://developer.nvidia.com/cuda-zone) is required for GPU mode.
* library version 7.0 and the latest driver version are recommended, but 6.* is fine too
* 5.5, and 5.0 are compatible but considered legacy
* [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) via ATLAS, MKL, or OpenBLAS.
* [Boost](http://www.boost.org/) >= 1.55
* `protobuf`, `glog`, `gflags`, `hdf5`

Optional dependencies:

* [OpenCV](http://opencv.org/) >= 2.4 including 3.0
* IO libraries: `lmdb`, `leveldb` (note: leveldb requires `snappy`)
* `protobuf`, `glog`, `gflags`
* IO libraries `hdf5`, `leveldb`, `snappy`, `lmdb`

Pycaffe and Matcaffe interfaces have their own natural needs.

Expand Down
26 changes: 0 additions & 26 deletions docs/multigpu.md

This file was deleted.

8 changes: 0 additions & 8 deletions examples/cpp_classification/classification.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#include <caffe/caffe.hpp>
#ifdef USE_OPENCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#endif // USE_OPENCV
#include <algorithm>
#include <iosfwd>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#ifdef USE_OPENCV
using namespace caffe; // NOLINT(build/namespaces)
using std::string;

Expand Down Expand Up @@ -258,8 +255,3 @@ int main(int argc, char** argv) {
<< p.first << "\"" << std::endl;
}
}
#else
int main(int argc, char** argv) {
LOG(FATAL) << "This example requires OpenCV; compile with USE_OPENCV.";
}
#endif // USE_OPENCV
12 changes: 0 additions & 12 deletions examples/mnist/convert_mnist_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <google/protobuf/text_format.h>

#if defined(USE_LEVELDB) && defined(USE_LMDB)
#include <leveldb/db.h>
#include <leveldb/write_batch.h>
#include <lmdb.h>
#endif

#include <stdint.h>
#include <sys/stat.h>

Expand All @@ -24,8 +20,6 @@

#include "caffe/proto/caffe.pb.h"

#if defined(USE_LEVELDB) && defined(USE_LMDB)

using namespace caffe; // NOLINT(build/namespaces)
using std::string;

Expand Down Expand Up @@ -202,9 +196,3 @@ int main(int argc, char** argv) {
}
return 0;
}
#else
int main(int argc, char** argv) {
LOG(FATAL) << "This example requires LevelDB and LMDB; " <<
"compile with USE_LEVELDB and USE_LMDB.";
}
#endif // USE_LEVELDB and USE_LMDB
9 changes: 1 addition & 8 deletions examples/siamese/convert_mnist_siamese_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@

#include "glog/logging.h"
#include "google/protobuf/text_format.h"
#include "leveldb/db.h"
#include "stdint.h"

#include "caffe/proto/caffe.pb.h"
#include "caffe/util/math_functions.hpp"

#ifdef USE_LEVELDB
#include "leveldb/db.h"

uint32_t swap_endian(uint32_t val) {
val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
return (val << 16) | (val >> 16);
Expand Down Expand Up @@ -123,8 +121,3 @@ int main(int argc, char** argv) {
}
return 0;
}
#else
int main(int argc, char** argv) {
LOG(FATAL) << "This example requires LevelDB; compile with USE_LEVELDB.";
}
#endif // USE_LEVELDB
Loading