Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit f6a2a6b

Browse files
committed
Merge Intel Caffe release_1.0.7.
2 parents c7ed327 + 7ef8316 commit f6a2a6b

File tree

71 files changed

+7945
-16295
lines changed

Some content is hidden

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

71 files changed

+7945
-16295
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ caffe_option(PERFORMANCE_MONITORING "Build Caffe with PERFORMANCE_MONITORING " O
4747

4848
# ---[ Dependencies
4949
include(cmake/MKLDNN.cmake)
50+
include(cmake/DLCP.cmake)
5051
include(cmake/Dependencies.cmake)
5152

5253
# ---[ Flags

Makefile

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@ endif
7171

7272
RETURN_STRING=$(shell ./external/mlsl/prepare_mlsl.sh)
7373
MLSL_ROOT=$(firstword $(RETURN_STRING))
74-
MLSL_LDFLAGS=$(lastword $(RETURN_STRING))
74+
MLSL_LDFLAGS=$(lastword $(RETURN_STRING))
7575
COMMON_FLAGS += -DUSE_MLSL=1
7676
LIBRARIES += mlsl
7777
INCLUDE_DIRS += $(MLSL_ROOT)/intel64/include
7878
LIBRARY_DIRS += $(MLSL_ROOT)/intel64/lib
79+
IGNORE := $(shell bash -c "source $(MLSL_ROOT)/intel64/bin/mlslvars.sh; env | sed 's/=/:=/' | sed 's/^/export /' > make_mlsl_env")
80+
include make_mlsl_env
7981

8082
ifeq ($(CAFFE_PER_LAYER_TIMINGS), 1)
8183
COMMON_FLAGS += -DCAFFE_PER_LAYER_TIMINGS
@@ -249,7 +251,13 @@ ifneq ($(CPU_ONLY), 1)
249251
LIBRARIES := cudart cublas curand
250252
endif
251253

252-
LIBRARIES += glog gflags protobuf m hdf5_hl hdf5
254+
LIBRARIES += glog gflags protobuf m
255+
ifeq ($(shell find /usr/lib* /usr/local/lib* -name "libhdf5_serial.so" 2> /dev/null | grep serial >/dev/null && echo serial) , serial)
256+
LIBRARIES += hdf5_serial_hl hdf5_serial
257+
else
258+
LIBRARIES += hdf5_hl hdf5
259+
endif
260+
253261
BOOST_LIBRARIES += boost_system boost_filesystem boost_regex
254262

255263
# handle IO dependencies
@@ -479,6 +487,11 @@ ifeq ($(WITH_PYTHON_LAYER), 1)
479487
LIBRARIES += $(PYTHON_LIBRARIES)
480488
endif
481489

490+
# Remove batch norm feature support
491+
ifeq ($(DISABLE_BN_FOLDING), 1)
492+
COMMON_FLAGS += -DDISABLE_BN_FOLDING
493+
endif
494+
482495
# Performance monitoring
483496
ifeq ($(PERFORMANCE_MONITORING), 1)
484497
CXXFLAGS += -DPERFORMANCE_MONITORING
@@ -489,6 +502,8 @@ ifeq ($(USE_MKLDNN_AS_DEFAULT_ENGINE), 1)
489502
CXXFLAGS += -DUSE_MKLDNN_AS_DEFAULT_ENGINE
490503
endif
491504

505+
include Makefile.dlcp
506+
492507
# BOOST configuration
493508
# detect support for custom boost version
494509
BOOST_LDFLAGS += $(foreach boost_lib,$(BOOST_LIBRARIES),-l$(boost_lib))
@@ -602,7 +617,7 @@ endif
602617
##############################
603618
.PHONY: all lib test clean docs linecount lint lintclean tools examples $(DIST_ALIASES) \
604619
py mat py$(PROJECT) mat$(PROJECT) proto runtest \
605-
superclean supercleanlist supercleanfiles warn everything mkldnn mkldnn_clean
620+
superclean supercleanlist supercleanfiles warn everything mkldnn mkldnn_clean dlcp dlcp_clean
606621

607622
.DEFAULT_GOAL := all
608623

@@ -757,14 +772,14 @@ $(ALL_BUILD_DIRS): | $(BUILD_DIR_LINK)
757772

758773
$(DYNAMIC_NAME): $(OBJS) | $(LIB_BUILD_DIR)
759774
@ echo LD -o $@
760-
$(Q)$(CXX) -shared -o $@ $(OBJS) $(VERSIONFLAGS) $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_SHARED_HARDENING_FLAGS) $(LDFLAGS)
775+
$(Q)$(CXX) -shared -o $@ $(OBJS) $(VERSIONFLAGS) $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_SHARED_HARDENING_FLAGS) $(LDFLAGS)
761776
@ cd $(BUILD_DIR)/lib; rm -f $(DYNAMIC_NAME_SHORT); ln -s $(DYNAMIC_VERSIONED_NAME_SHORT) $(DYNAMIC_NAME_SHORT)
762777

763778
$(STATIC_NAME): $(OBJS) | $(LIB_BUILD_DIR)
764779
@ echo AR -o $@
765780
$(Q)ar rcs $@ $(OBJS)
766781

767-
$(BUILD_DIR)/%.o: %.cpp | mkldnn $(ALL_BUILD_DIRS)
782+
$(BUILD_DIR)/%.o: %.cpp | mkldnn dlcp $(ALL_BUILD_DIRS)
768783
@ echo CXX $<
769784
$(Q)$(CXX) $< $(CXX_HARDENING_FLAGS) $(CXXFLAGS) -c -o $@ 2> $@.$(WARNS_EXT) \
770785
|| (cat $@.$(WARNS_EXT); exit 1)
@@ -789,7 +804,7 @@ $(TEST_ALL_BIN): $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJS) \
789804
| $(DYNAMIC_NAME) $(TEST_BIN_DIR)
790805
@ echo CXX/LD -o $@ $<
791806
$(Q)$(CXX) -std=c++11 $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJS) \
792-
-o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
807+
-o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
793808

794809
$(TEST_CU_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CU_BUILD_DIR)/%.o \
795810
$(GTEST_OBJS) | $(DYNAMIC_NAME) $(TEST_BIN_DIR)
@@ -801,7 +816,7 @@ $(TEST_CXX_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CXX_BUILD_DIR)/%.o \
801816
$(GTEST_OBJS) | $(DYNAMIC_NAME) $(TEST_BIN_DIR)
802817
@ echo LD $<
803818
$(Q)$(CXX) -std=c++11 $(TEST_MAIN_SRC) $< $(GTEST_OBJS) \
804-
-o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
819+
-o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
805820

806821
# Target for extension-less symlinks to tool binaries with extension '*.bin'.
807822
$(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR)
@@ -810,12 +825,12 @@ $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR)
810825

811826
$(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME)
812827
@ echo CXX/LD -o $@
813-
$(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \
828+
$(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \
814829
-Wl,-rpath,$(ORIGIN)/../lib
815830

816831
$(EXAMPLE_BINS): %.bin : %.o | $(DYNAMIC_NAME)
817832
@ echo CXX/LD -o $@
818-
$(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \
833+
$(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \
819834
-Wl,-rpath,$(ORIGIN)/../../lib
820835

821836
proto: $(PROTO_GEN_CC) $(PROTO_GEN_HEADER)
@@ -833,7 +848,7 @@ $(PY_PROTO_BUILD_DIR)/%_pb2.py : $(PROTO_SRC_DIR)/%.proto \
833848
$(PY_PROTO_INIT): | $(PY_PROTO_BUILD_DIR)
834849
touch $(PY_PROTO_INIT)
835850

836-
clean: mkldnn_clean
851+
clean: mkldnn_clean dlcp_clean
837852
@echo "Will download the new version of MKL2017 and MLSL when clean and prepare the environment."
838853
@- $(RM) -rf $(ALL_BUILD_DIRS)
839854
@- $(RM) -rf $(OTHER_BUILD_DIR)

Makefile.config.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ USE_MKLDNN_AS_DEFAULT_ENGINE := 1
7676
# already.
7777
# BOOST_ROOT :=
7878

79+
# Use remove batch norm optimization to boost inferrence
80+
DISABLE_BN_FOLDING := 0
7981
# Intel(r) Machine Learning Scaling Library (uncomment to build
8082
# with MLSL for multi-node training)
8183
# USE_MLSL :=1
@@ -115,6 +117,8 @@ BLAS := mkl
115117
# MATLAB_DIR := /usr/local
116118
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
117119

120+
SERIAL_HDF5_INCLUDE := /usr/include/hdf5/serial/
121+
118122
# NOTE: this is required only if you will compile the python interface.
119123
# We need to be able to find Python.h and numpy/arrayobject.h.
120124
PYTHON_INCLUDE := /usr/include/python2.7 \
@@ -143,7 +147,7 @@ PYTHON_LIB := /usr/lib
143147
# WITH_PYTHON_LAYER := 1
144148

145149
# Whatever else you find you need goes here.
146-
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
150+
INCLUDE_DIRS := $(PYTHON_INCLUDE) ${SERIAL_HDF5_INCLUDE} /usr/local/include
147151
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
148152

149153
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies

Makefile.dlcp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
CAFFE_ROOTDIR := $(shell pwd)
2+
DLCP_IDEEPDIR := $(CAFFE_ROOTDIR)/external/ideep
3+
DLCP_ROOTDIR := $(DLCP_IDEEPDIR)/ideep/dlcp
4+
DLCP_INCLDIR := $(DLCP_ROOTDIR)/include
5+
DLCP_LIBDIR := $(DLCP_ROOTDIR)/lib
6+
IDEEP_GITHUB := https://github.com/intel/ideep.git
7+
DLCP_CXX := $(CXX)
8+
9+
ifeq ("$(wildcard $(DLCP_INCLDIR)/dl_compression.h)", "")
10+
dlcp_download:
11+
rm -rf $(DLCP_IDEEPDIR)
12+
git clone $(IDEEP_GITHUB) -b dlcp $(DLCP_IDEEPDIR)
13+
14+
dlcp_build: dlcp_download
15+
make -C $(DLCP_ROOTDIR) -j$(shell cat /proc/cpuinfo |grep 'processor'|wc -l)
16+
else
17+
dlcp_download:
18+
dlcp_build:
19+
make -C $(DLCP_ROOTDIR) -j$(shell cat /proc/cpuinfo |grep 'processor'|wc -l)
20+
endif
21+
22+
dlcp_clean:
23+
@rm -rf $(DLCP_IDEEPDIR)
24+
25+
dlcproot_set:
26+
$(eval COMMON_FLAGS += -DENABLE_WEIGHT_GRAD_COMPRESSION) \
27+
$(eval INCLUDE_DIRS += $(DLCP_INCLDIR)) \
28+
$(eval DLCP_LDFLAGS += -ldlcomp -L$(DLCPROOT)/lib) \
29+
$(eval DLCP_LDFLAGS += -Wl,-rpath,$(DLCPROOT)/lib)
30+
31+
32+
dlcproot_notset: dlcp_build
33+
$(eval COMMON_FLAGS += -DENABLE_WEIGHT_GRAD_COMPRESSION) \
34+
$(eval INCLUDE_DIRS += $(DLCP_INCLDIR)) \
35+
$(eval DLCP_LDFLAGS += -ldlcomp) \
36+
$(eval DLCP_LDFLAGS += -L$(DLCP_LIBDIR) -Wl,-rpath,${DLCP_LIBDIR})
37+
38+
ifeq (,$(findstring icpc, $(DLCP_CXX)))
39+
ifneq (,$(findstring icpc,$(shell command -v icpc)))
40+
DLCP_CXX := icpc
41+
endif
42+
endif
43+
44+
ifeq ($(USE_MLSL), 1)
45+
ifeq ($(origin DLCPROOT), environment)
46+
dlcp: dlcproot_set
47+
else
48+
ifneq (,$(findstring icpc,$(DLCP_CXX)))
49+
dlcp: dlcproot_notset
50+
else
51+
dlcp:
52+
@echo "weight grad compression disabled because intel compiler not found"
53+
endif
54+
endif
55+
else
56+
dlcp:
57+
@echo "disabling weight grad compression if USE_MLSL is not 1"
58+
endif

cmake/DLCP.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function(Download_DLCP)
2+
find_program(HAS_ICPC NAMES icpc DOC "Intel Compiler")
3+
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
4+
set(DLCP_CXX "${CMAKE_CXX_COMPILER}" PARENT_SCOPE)
5+
elseif(HAS_ICPC)
6+
set(DLCP_CXX "icpc" PARENT_SCOPE)
7+
else()
8+
message(WARNING "weight grad compression is disabled because intel compiler is not found")
9+
return()
10+
endif()
11+
12+
set(EXTERNAL_DIR ${CMAKE_SOURCE_DIR}/external)
13+
set(DLCP_IDEEPDIR ${EXTERNAL_DIR}/ideep)
14+
set(DLCP_ROOTDIR ${DLCP_IDEEPDIR}/ideep/dlcp)
15+
set(DLCP_INCLDIR "${DLCP_ROOTDIR}/include" PARENT_SCOPE)
16+
set(DLCP_LIBDIR ${DLCP_ROOTDIR}/lib PARENT_SCOPE)
17+
18+
# Download dl compression lib source code if it doesn't exist
19+
if (NOT EXISTS ${DLCP_INCLDIR}/dl_compression.h)
20+
execute_process(COMMAND rm -rf ${DLCP_IDEEPDIR})
21+
execute_process(COMMAND git clone https://github.com/intel/ideep.git -b dlcp ${DLCP_IDEEPDIR})
22+
endif()
23+
24+
add_custom_target(DLCP_Build ALL
25+
COMMAND export DLCP_CXX=${DLCP_CXX}
26+
COMMAND make -j
27+
WORKING_DIRECTORY ${DLCP_ROOTDIR})
28+
29+
endfunction(Download_DLCP)

cmake/Dependencies.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,33 @@ if(USE_MLSL)
132132
endif()
133133
endif()
134134

135+
# ---| DLCP
136+
if(USE_MLSL)
137+
if(DEFINED ENV{DLCPROOT})
138+
set(DLCPROOT_DIR $ENV{DLCPROOT})
139+
if(NOT ${DLCPROOT_DIR} STREQUAL "")
140+
set(DLCPROOT_INCLUDE_DIR "${DLCPROOT_DIR}/include/")
141+
set(DLCPROOT_LIB_DIR "${DLCPROOT_DIR}/lib/")
142+
if(EXISTS ${DLCPROOT_INCLUDE_DIR}/dl_compression.h AND EXISTS ${DLCPROOT_LIB_DIR}/libdlcomp.so)
143+
message(STATUS "Found DLCP: ${DLCPROOT_DIR}")
144+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_WEIGHT_GRAD_COMPRESSION")
145+
list(APPEND Caffe_LINKER_LIBS "${DLCPROOT_LIB_DIR}/libdlcomp.so")
146+
include_directories(SYSTEM ${DLCP_INCLUDE_DIR})
147+
else()
148+
message(STATUS "DLCP not found. DLCP_INCLUDE_DIR = ${DLCPROOT_INCLUDE_DIR} DLCP_LIB_DIR = ${DLCPROOT_LIB_DIR}")
149+
message(WARNING "weight grad compression is disabled.")
150+
endif()
151+
endif()
152+
else()
153+
Download_DLCP()
154+
if(DLCP_CXX)
155+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_WEIGHT_GRAD_COMPRESSION")
156+
list(APPEND Caffe_LINKER_LIBS "${DLCP_LIBDIR}/libdlcomp.so")
157+
include_directories(SYSTEM ${DLCP_INCLDIR})
158+
endif()
159+
endif()
160+
endif()
161+
135162
# ---[ BLAS
136163
set(MKL_EXTERNAL "0")
137164
if(NOT APPLE)

cmake/Misc.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if(DEFINED CMAKE_BUILD_TYPE)
66
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
77
endif()
88

9+
if(DISABLE_BN_FOLDING)
10+
message(STATUS "Bn folding is disabled!")
11+
add_definitions("-DDISABLE_BN_FOLDING")
12+
endif()
913
# --[ If user doesn't specify build type then assume release
1014
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
1115
set(CMAKE_BUILD_TYPE Release)

docker/standalone/cpu-ubuntu/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2323
python-dev \
2424
python-numpy \
2525
python-pip \
26+
python-setuptools \
2627
python-scipy && \
2728
rm -rf /var/lib/apt/lists/*
2829

@@ -32,6 +33,8 @@ WORKDIR $CAFFE_ROOT
3233
# FIXME: clone a specific git tag and use ARG instead of ENV once DockerHub supports this.
3334
ENV CLONE_TAG=master
3435

36+
RUN pip install --upgrade pip
37+
3538
RUN git clone -b ${CLONE_TAG} --depth 1 https://github.com/intel/caffe.git . && \
3639
for req in $(cat python/requirements.txt) pydot; do pip install $req; done && \
3740
mkdir build && cd build && \

examples/LRCN_activity_recognition/README.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,31 @@ Chicago
55

66
Please see http://www.eecs.berkeley.edu/~lisa_anne/LRCN_video for detailed instructions on how to reimplement experiments and download pre-trained models.
77

8+
# Support Flow LRCN From Quadra_L
9+
- [Quadra_L](http://www.swcontest.net/index.php?a=show&m=news&aid=177)
10+
## Preparing
11+
- install protocol buffer 3.4.0, referring this link http://blog.csdn.net/twilightdream/article/details/72953338
12+
- sudo -H pip install --upgrade protobuf==3.1.0.post1
13+
- sudo apt-get install libhdf5-dev
14+
- sudo apt-get install python-h5py
15+
## Building
16+
- remember WITH_PYTHON_LAYER := 1 !
17+
- make all
18+
- make pycaffe
19+
20+
## Training
21+
- download data and models from http://www.eecs.berkeley.edu/~lisa_anne/LRCN_video,
22+
- create flow frame using python instead of matlab like below
23+
https://github.com/pathak22/pyflow
24+
git clone https://github.com/pathak22/pyflow.git
25+
cd pyflow/
26+
python setup.py build_ext -i
27+
python demo.py # -viz option to visualize output
28+
- change my path like '/home/link/frames' in sequence_input_layer.py to your path and modify other relative path.
29+
- bash run_lstm_flow.sh, start training!
30+
31+
32+
33+
34+
35+

examples/LRCN_activity_recognition/sequence_input_layer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import skimage.io
2424
import copy
2525

26-
flow_frames = 'flow_images/'
27-
RGB_frames = 'frames/'
26+
flow_frames = '/home/link/flow_images/'
27+
RGB_frames = '/home/link/frames/'
2828
test_frames = 16
2929
train_frames = 16
3030
test_buffer = 3
@@ -174,11 +174,11 @@ def setup(self, bottom, top):
174174
if self.flow:
175175
image_mean = [128, 128, 128]
176176
# TODO: No flow support in transformer currently
177-
# self.transformer.set_is_flow('data_in', True)
177+
self.transformer.set_is_flow('data_in', True)
178178
else:
179179
image_mean = [103.939, 116.779, 128.68]
180180
# TODO: No flow support in transformer currently
181-
# self.transformer.set_is_flow('data_in', False)
181+
self.transformer.set_is_flow('data_in', False)
182182
channel_mean = np.zeros((3,227,227))
183183
for channel_index, mean_val in enumerate(image_mean):
184184
channel_mean[channel_index, ...] = mean_val

0 commit comments

Comments
 (0)