提交 400fa464 编写于 作者: G gineshidalgo99

Added c++11 flag to Caffe + edited Caffe installation doc

上级 340622fe
......@@ -40,6 +40,9 @@ DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
DYNAMIC_NAME := $(LIB_BUILD_DIR)/$(DYNAMIC_VERSIONED_NAME_SHORT)
COMMON_FLAGS += -DCAFFE_VERSION=$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
# OpenPose: added C++11 flag to avoid crashing in some old GCC compilers
COMMON_FLAGS += -std=c++11
# OpenPose: end modified
##############################
# Get all source files
......@@ -319,7 +322,9 @@ ifeq ($(DEBUG), 1)
COMMON_FLAGS += -DDEBUG -g -O0
NVCCFLAGS += -G
else
COMMON_FLAGS += -DNDEBUG -O2
# OpenPose: modified `-O2` by `-O3`
COMMON_FLAGS += -DNDEBUG -O3
# OpenPose: end modified
endif
# cuDNN acceleration configuration.
......
......@@ -71,9 +71,9 @@ else
cp Makefile.config.Ubuntu16.example Makefile.config
fi
# make all -j$NUM_CORES
make distribute -j$NUM_CORES
make all -j$NUM_CORES && make distribute -j$NUM_CORES
# make test -j$NUM_CORES
# make runtest -j$NUM_CORES # This command crashes due to the new added layers
# make runtest -j$NUM_CORES
exitIfError
echo "------------------------- Caffe Compiled -------------------------"
echo ""
......
......@@ -182,6 +182,16 @@ Just comment on GibHub or make a pull request! We will answer you back as soon a
## Custom Caffe
We only modified some Caffe compilation flags and minor details. You can use use your own Caffe distribution, these are the files we added and modified:
1. Added files: `install_caffe.sh`; as well as `Makefile.config.Ubuntu14.example`, `Makefile.config.Ubuntu16.example`, `Makefile.config.Ubuntu14_cuda_7.example` and `Makefile.config.Ubuntu16_cuda_7.example` (extracted from `Makefile.config.example`). Basically, you must enable cuDNN.
2. Edited file: Makefile. Search for "# OpenPose: " to find the edited code. We basically added the C++11 flag to avoid issues in some old computers.
3. Optional - deleted Caffe file: `Makefile.config.example`.
4. Finally, run `make all && make distribute` in your Caffe version and modify the Caffe directory variable in our Makefile config file: `./Makefile.config.UbuntuX.example` (where X is 14 or 16 depending on your Ubuntu version), set the `CAFFE_DIR` parameter to the path where both the `include` and `lib` Caffe folders are located.
## Citation
Please cite the paper in your publications if it helps your research:
......
......@@ -28,7 +28,7 @@ cp Makefile.config.Ubuntu14.example Makefile.config # Ubuntu 14, cuda 8
cp Makefile.config.Ubuntu16_cuda_7.example Makefile.config # Ubuntu 16, cuda 7
cp Makefile.config.Ubuntu16.example Makefile.config # Ubuntu 16, cuda 8
# Compile Caffe
make distribute -j${number_of_cpus}
make all -j${number_of_cpus} && make distribute -j${number_of_cpus}
### Install OpenPose ###
cd ../../models/
......@@ -49,10 +49,3 @@ Note: These steps only need to be performed once. If you are interested in makin
make clean
make all -j$(NUM_CORES)
```
## Custom Caffe
We slightly modified some Caffe compilation flags and minor details. In case you want to use your own Caffe distribution, these are the files we added and modified:
1. Added files: `install_caffe_and_openpose.sh`; as well as `Makefile.config.Ubuntu14.example`, `Makefile.config.Ubuntu16.example`, `Makefile.config.Ubuntu14_cuda_7.example` and `Makefile.config.Ubuntu16_cuda_7.example` (extracted from `Makefile.config.example`).
2. Optional - deleted Caffe files and folders (only to save space): `Makefile.config.example`, `data/`, `examples/` (editing the Makefile distribute section to avoid using this folder) and `models/`.
3. Finally, run `make distribute` in your Caffe version and modify the Caffe directory variable in our Makefile config file: `./Makefile.config.UbuntuX.example` (where X is 14 or 16 depending on your Ubuntu version), set the `CAFFE_DIR` parameter to the path where both the `include` and `lib` Caffe folders are located.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册