forked from breadbread1984/Caffe2-C-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (25 loc) · 1.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
CAFFE2_PREFIX=/home/xieyi/opt/caffe2
CXXFLAGS = `pkg-config --cflags opencv eigen3` -Isrc -I${CAFFE2_PREFIX}/include -std=c++14 -DWITH_CUDA
LIBS=`pkg-config --libs opencv eigen3` -lboost_program_options -L${CAFFE2_PREFIX}/lib -lcaffe2_gpu -lcaffe2 -lglog -lcudart -lcurand
OBJS=$(patsubst %.cpp,%.o,$(wildcard src/*.cpp))
all: train test predictor
predictor: $(OBJS)
$(CXX) $^ $(LIBS) -o ${@}
.PHONY: train test dataset
dataset:
mkdir tmp
curl --progress-bar http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz | gunzip > tmp/train-images-idx3-ubyte
curl --progress-bar http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz | gunzip > tmp/train-labels-idx1-ubyte
make_mnist_db --image_file=tmp/train-images-idx3-ubyte --label_file=tmp/train-labels-idx1-ubyte --output_file=mnist-train-nchw-leveldb --channel_first --db leveldb
curl --progress-bar http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz | gunzip > tmp/t10k-images-idx3-ubyte
curl --progress-bar http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz | gunzip > tmp/t10k-labels-idx1-ubyte
make_mnist_db --image_file=tmp/t10k-images-idx3-ubyte --label_file=tmp/t10k-labels-idx1-ubyte --output_file=mnist-test-nchw-leveldb --channel_first --db leveldb
$(RM) -r tmp
train: train_plan.pbtxt
run_plan --plan $^
test: test_plan.pbtxt
run_plan --plan $^
clean:
$(RM) *.log *.summary
$(RM) -r LeNet_params
$(RM) predictor $(OBJS)