Skip to content

Commit b2ff0dc

Browse files
author
zhangdanfeng
committed
update models
Signed-off-by: zhangdanfeng <[email protected]>
1 parent 3023819 commit b2ff0dc

19 files changed

+16309
-131
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ dkms.conf
5656
*.swp
5757
tflite_*
5858
build*/
59+
m5out/

TEMP.md

Lines changed: 0 additions & 129 deletions
This file was deleted.

classification.cc

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,38 @@
1616
*/
1717

1818
/*
19-
rm classification/tflite_classification & make -f Makefile-rv
19+
rm -f classification/tflite_classification && make -f Makefile-rv
20+
2021
qemu-riscv64 classification/tflite_classification -m \
2122
classification/imagenet_mobilenet_v1_100_224_classification.tflite -i \
2223
classification/dog.jpg -l classification/labels.txt -c 1 -b 0 -s 255 -t 1
24+
# label: Blenheim spaniel with probability 18.3755
25+
26+
qemu-riscv64 classification/tflite_classification -m \
27+
classification/imagenet_mobilenet_v2_100_224_classification.tflite -i \
28+
classification/dog.jpg -l classification/labels.txt -c 1 -b 0 -s 255 -t 1
29+
# label: Blenheim spaniel with probability 9.8589
30+
31+
qemu-riscv64 classification/tflite_classification -m \
32+
classification/imagenet_inception_v1_classification_5.tflite -i \
33+
classification/dog.jpg -l classification/labels.txt -c 1 -b 0 -s 255 -t 1
34+
# label: Blenheim spaniel with probability 10.9008
35+
36+
qemu-riscv64 classification/tflite_classification -m \
37+
classification/imagenet_inception_v2_classification_5.tflite -i \
38+
classification/dog.jpg -l classification/labels.txt -c 1 -b 0 -s 255 -t 1
39+
# label: Blenheim spaniel with probability 11.0233 有bug
40+
41+
qemu-riscv64 classification/tflite_classification -m \
42+
classification/imagenet_resnet_v1_50_classification_5.tflite -i \
43+
classification/dog.jpg -l classification/labels.txt -c 1 -b 0 -s 255 -t 1
44+
# label: Blenheim spaniel with probability 16.8781
45+
46+
qemu-riscv64 classification/tflite_classification -m \
47+
classification/imagenet_resnet_v2_50_classification_5.tflite -i \
48+
classification/dog.jpg -l classification/labels.txt -c 1 -b 0 -s 255 -t 1
49+
# label: Blenheim spaniel with probability 19.5378
50+
2351
*/
2452

2553
#include <getopt.h>
@@ -115,6 +143,23 @@ void display_usage() {
115143
<< "--threads, -t: number of threads\n"
116144
<< "\n";
117145
}
146+
147+
#ifdef MEM_PROFILE
148+
149+
#ifdef __cplusplus
150+
extern "C" {
151+
#endif
152+
extern size_t packed_weight_in_byte;
153+
extern size_t packed_feature_in_byte;
154+
155+
extern size_t packed_weight_access_in_byte;
156+
extern size_t packed_feature_access_in_byte;
157+
#ifdef __cplusplus
158+
}
159+
#endif
160+
161+
#endif
162+
118163
// (input - mean) / std
119164
/*
120165
* Main function
@@ -332,7 +377,18 @@ int main(int argc, char **argv) {
332377

333378
std::cout << "Classification complete ! " << std::endl;
334379

335-
// IMPORTANT: release the interpreter before destroying the delegate
380+
#ifdef MEM_PROFILE
381+
std::cout << "packed_weight_in_byte = " << packed_weight_in_byte << std::endl
382+
<< "packed_feature_in_byte = " << packed_feature_in_byte
383+
<< std::endl
384+
<< "packed_weight_access_in_byte = " << packed_weight_access_in_byte
385+
<< std::endl
386+
<< "packed_feature_access_in_byte = "
387+
<< packed_feature_access_in_byte << std::endl;
388+
#endif
389+
390+
// IMPORTANT: release the interpreter before destroying the
391+
// delegate
336392
interpreter.reset();
337393
// TfLiteXNNPackDelegateDelete(xnnpack_delegate);
338394

Binary file not shown.
Binary file not shown.
Binary file not shown.
59.8 MB
Binary file not shown.
-7.17 MB
Binary file not shown.

0 commit comments

Comments
 (0)