-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
45 lines (38 loc) · 1.49 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
MODEL_CKPT=NN
OUTPUT_NODE_NAME=Output
INPUT_NODE_NAME=Input
runNN:
python3 Script.py
.PHONY: freeze
freeze: runNN
@echo "\nFreezing model..."
(cd model; python3 /home/tensorflow/tensorflow/python/tools/freeze_graph.py \
--input_graph=$(MODEL_CKPT).pb \
--input_binary=true \
--input_checkpoint=$(MODEL_CKPT).ckpt \
--output_graph=$(MODEL_CKPT)_frozen.pb \
--output_node_name=$(OUTPUT_NODE_NAME);)
.PHONY: compile
compile: freeze
@echo "\nCompiling model to Movidius graph..."
(cd model; mvNCCompile -s 12 $(MODEL_CKPT)_frozen.pb -in=$(INPUT_NODE_NAME) -on=$(OUTPUT_NODE_NAME);)
.PHONY: profile
profile: freeze
@echo "\nProfiling the model..."
(cd model; mvNCProfile -s 12 $(MODEL_CKPT)_frozen.pb -in=$(INPUT_NODE_NAME) -on=$(OUTPUT_NODE_NAME);)
.PHONY: check
check: freeze
@echo "\nComparing results with standard TensorFlow..."
(cd model; mvNCCheck -s 12 $(MODEL_CKPT)_frozen.pb -in=$(INPUT_NODE_NAME) -on=$(OUTPUT_NODE_NAME);)
.PHONY: help
help:
@echo "\nPossible make targets: ";
@echo " make help - Shows this message.";
@echo " make freeze - Export the trained model for inference.";
@echo " make compile - Convert the trained model into Movidius graph file.";
@echo " make check - Compare inference results with that of TensorFlow running on CPU/GPU.";
@echo " make profile - Run the model on NCS and extract complexity, bandwidth and execution time for each layer.";
.PHONY: clean
clean:
@echo "\nMaking clean...";
rm -rf model