Skip to content

Commit

Permalink
Merge branch 'master' into DeepCrowd
Browse files Browse the repository at this point in the history
* master:
  Makefile bugfix: OTHER_BUILD_DIR name set incorrectly when empty due to lazy variable expansion when using the `?=` operator -- change them to explicit empty string checks with simple assignment operator `:=`.
  minor cmake fix - now Caffe complains when cmake is executed if glog/gflags are not found.
  Import Pandas in HDF5 IPython notebook. Fix for issue BVLC#2247
  Net::Update: CPU_ONLY is in wrong place
  fix a typo that GFLAGS_GFLAGS_H_ -> GFLAGS_GFAGS_H_
  fix typo: swap the titles of xlabel and ylabel
  clarify Makefile.config check
  Fix RCNN model fetching script
  Abort Makefile parsing if the configuration file cannot be found.
  set default DISTRIBUTE_DIR -- fix BVLC#2328
  improved installation for osx
  Changing Image import to be imported from PIL.
  • Loading branch information
myfavouritekk committed May 5, 2015
2 parents 2a5648a + cd0eda3 commit 6ff6678
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 12 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
PROJECT := caffe

CONFIG_FILE := Makefile.config
# Explicitly check for the config file, otherwise make -k will proceed anyway.
ifeq ($(wildcard $(CONFIG_FILE)),)
$(error $(CONFIG_FILE) not found. See $(CONFIG_FILE).example.)
endif
include $(CONFIG_FILE)

BUILD_DIR_LINK := $(BUILD_DIR)
RELEASE_BUILD_DIR ?= .$(BUILD_DIR)_release
DEBUG_BUILD_DIR ?= .$(BUILD_DIR)_debug
ifeq ($(RELEASE_BUILD_DIR),)
RELEASE_BUILD_DIR := .$(BUILD_DIR)_release
endif
ifeq ($(DEBUG_BUILD_DIR),)
DEBUG_BUILD_DIR := .$(BUILD_DIR)_debug
endif

DEBUG ?= 0
ifeq ($(DEBUG), 1)
Expand Down Expand Up @@ -171,6 +179,7 @@ WARNINGS := -Wall -Wno-sign-compare
# Set build directories
##############################

DISTRIBUTE_DIR ?= distribute
DISTRIBUTE_SUBDIRS := $(DISTRIBUTE_DIR)/bin $(DISTRIBUTE_DIR)/lib
DIST_ALIASES := dist
ifneq ($(strip $(DISTRIBUTE_DIR)),distribute)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindGFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ else()
find_library(GFLAGS_LIBRARY gflags)
endif()

find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFLAGS_INCLUDE_DIR GFLAGS_LIBRARY)
find_package_handle_standard_args(GFlags DEFAULT_MSG GFLAGS_INCLUDE_DIR GFLAGS_LIBRARY)


if(GFLAGS_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindGlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else()
PATH_SUFFIXES lib lib64)
endif()

find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_INCLUDE_DIR GLOG_LIBRARY)
find_package_handle_standard_args(Glog DEFAULT_MSG GLOG_INCLUDE_DIR GLOG_LIBRARY)

if(GLOG_FOUND)
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion docs/install_osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In other `ENV` settings, things may not work as expected.
brew install --fresh -vd snappy leveldb gflags glog szip lmdb
# need the homebrew science source for OpenCV and hdf5
brew tap homebrew/science
hdf5 opencv
brew install hdf5 opencv

If using Anaconda Python, a modification to the OpenCV formula might be needed
Do `brew edit opencv` and change the lines that look like the two lines below to exactly the two lines below.
Expand Down
2 changes: 1 addition & 1 deletion examples/detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"\n",
"- [Selective Search](http://koen.me/research/selectivesearch/) is the region proposer used by R-CNN. The [selective_search_ijcv_with_python](https://github.com/sergeyk/selective_search_ijcv_with_python) Python module takes care of extracting proposals through the selective search MATLAB implementation. To install it, download the module and name its directory `selective_search_ijcv_with_python`, run the demo in MATLAB to compile the necessary functions, then add it to your `PYTHONPATH` for importing. (If you have your own region proposals prepared, or would rather not bother with this step, [detect.py](https://github.com/BVLC/caffe/blob/master/python/detect.py) accepts a list of images and bounding boxes as CSV.)\n",
"\n",
"-Run `./scripts/download_model_binary.py models/bvlc_reference_caffenet` to get the Caffe R-CNN ImageNet model.\n",
"-Run `./scripts/download_model_binary.py models/bvlc_reference_rcnn_ilsvrc13` to get the Caffe R-CNN ImageNet model.\n",
"\n",
"With that done, we'll call the bundled `detect.py` to generate the region proposals and run the network. For an explanation of the arguments, do `./detect.py --help`."
]
Expand Down
1 change: 1 addition & 0 deletions examples/hdf5_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"collapsed": false,
"input": [
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/web_demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import tornado.httpserver
import numpy as np
import pandas as pd
import Image
from PIL import Image
import cStringIO as StringIO
import urllib
import exifutil
Expand Down
2 changes: 1 addition & 1 deletion include/caffe/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "caffe/util/device_alternate.hpp"

// gflags 2.1 issue: namespace google was changed to gflags without warning.
// Luckily we will be able to use GFLAGS_GFAGS_H_ to detect if it is version
// Luckily we will be able to use GFLAGS_GFLAGS_H_ to detect if it is version
// 2.1. If yes, we will add a temporary solution to redirect the namespace.
// TODO(Yangqing): Once gflags solves the problem in a more elegant way, let's
// remove the following hack.
Expand Down
4 changes: 2 additions & 2 deletions src/caffe/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,15 @@ void Net<Dtype>::Update() {
owner_diff = params_[param_owners_[i]]->mutable_cpu_diff();
caffe_add(count, this_diff, owner_diff, owner_diff);
break;
#ifndef CPU_ONLY
case Caffe::GPU:
#ifndef CPU_ONLY
this_diff = params_[i]->gpu_diff();
owner_diff = params_[param_owners_[i]]->mutable_gpu_diff();
caffe_gpu_add(count, this_diff, owner_diff, owner_diff);
break;
#else
NO_GPU;
#endif
break;
default:
LOG(FATAL) << "Unknown caffe mode: " << Caffe::mode();
}
Expand Down
4 changes: 2 additions & 2 deletions tools/extra/plot_log.gnuplot.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ set key right

# Training loss vs. training iterations
set title "Training loss vs. training iterations"
set xlabel "Training loss"
set ylabel "Training iterations"
set xlabel "Training iterations"
set ylabel "Training loss"
plot "mnist.log.train" using 1:3 title "mnist"

# Training loss vs. training time
Expand Down

0 comments on commit 6ff6678

Please sign in to comment.