Function Testing

Basic function testing

The Basic function testing use the network model(minist) and data include in the installation package for Neural Network inference, the test results will be output to the out subdirectory of the current directory, please make sure that the user has the write rights to the current directory.
1
$ source /opt/bmtap2/bm1880-<Mode>-x.y.z /test/test_bmnet.sh
2
$ mkdir out
3
$ run_test_bmnet_bm1880
Copied!
Test test results are as follow:
1
$ run_test_bmnet_bm1880
2
begin to test net:mnist mnist <4,1,28,28>,epsilon:0.00001
3
<CMD>test_bmnet_bmodel /opt/bmtap2/bm1880-pcie_1.0.1/test/mnist/mnist_input_4_1_28_28.bin /opt/bmtap2/bm1880-pcie_1.0.1/test/mnist/mnist_4_1_28_28.bmodel out//mnist_output.bin 4 1 28 28 0.00001
4
input size:12544
5
WARRING:Logging before InitgoogleLogging()is written to STDERR
Copied!
1
# run_test_bmnet_bm1880
2
begin to test net: mtcnn det1 <1,3,12,12>
3
<CMD> test_bmnet_bmodel /opt/bmtap2/bm1880-usb_1.0.1/test/../models/mtcnn/det1_input_1_3_12_12.bin /opt/bmtap2/bm1880-usb_1.0.1/test/../models/mtcnn/det1_1_3_12_12.bmodel out//det1_output.bin 1 3 12 12
4
input size: 432
5
WARNING: Logging before InitGoogleLogging() is written to STDERR
6
I1026 19:41:03.865362 2635 bm_firmware.cpp:76] check firmware status ...
7
I1026 19:41:03.865628 2635 bm_firmware.cpp:82] firmware loading ...
8
I1026 19:41:03.929674 2635 bm_firmware.cpp:47] firmware load success
9
I1026 19:41:08.937716 2635 bm_firmware.cpp:98] firmware is running
10
I1026 19:41:08.937757 2635 bm_device.cpp:104] device[0] opened,gmem_size : 0x40000000
11
output size:6
12
outputs[0]: [1,4,1,1], "conv4-2"
13
outputs[1]: [1,2,1,1], "conv4-1"
14
test_bmnet_bmodel: load 107 us, run 106 us, read 76 us
15
('/opt/bmtap2/bm1880-usb_1.0.1/test/../models/mtcnn/det1_output_1_3_12_12_ref.bin', ' vs. ', 'out//det1_output.bin')
16
Result matched @ epsilon = 0.000000
17
det1<1,3,12,12> passed
18
begin to test net: mobilenet mobilenet <1,3,224,224>
19
<CMD> test_bmnet_bmodel /opt/bmtap2/bm1880-usb_1.0.1/test/../models/mobilenet/mobilenet_input_1_3_224_224.bin /opt/bmtap2/bm1880-usb_1.0.1/test/../models/mobilenet/mobilenet_1_3_224_224.bmodel out//mobilenet_output.bin 1 3 224 224
20
input size: 150528
21
WARNING: Logging before InitGoogleLogging() is written to STDERR
22
I1026 19:41:09.092887 2662 bm_firmware.cpp:76] check firmware status ...
23
I1026 19:41:09.093133 2662 bm_firmware.cpp:85] firmware is running
24
I1026 19:41:09.093152 2662 bm_device.cpp:104] device[0] opened,gmem_size : 0x40000000
25
output size:1000
26
outputs[0]: [1,1000,1,1], "fc7"
27
test_bmnet_bmodel: load 3773 us, run 2820 us, read 222 us
28
('/opt/bmtap2/bm1880-usb_1.0.1/test/../models/mobilenet/mobilenet_output_1_3_224_224_ref.bin', ' vs. ', 'out//mobilenet_output.bin')
29
Result matched @ epsilon = 0.000000
30
mobilenet<1,3,224,224> passed
31
test_bmnet_bm1880 success
Copied!

Python API testing

BMNNSDK provide Python Wrapper,and you can use the python interface for deeplearning application development:
1
// bmnet inference test
2
$ python /opt/bmtap2/bm1880-<MODE>_x.y.z/python/test/test_mobilenet.py
Copied!
The testing results are as follows:
1
# python /opt/bmtap2/bm1880-usb_1.0.1/python/test/test_mobilenet.py
2
WARNING: Logging before InitGoogleLogging() is written to STDERR
3
I1103 11:35:07.977723 21141 bm_firmware.cpp:76] check firmware status ...
4
I1103 11:35:07.977876 21141 bm_firmware.cpp:85] firmware is running
5
I1103 11:35:07.977897 21141 bm_device.cpp:104] device[0] opened,gmem_size : 0x40000000
6
input size 150528
7
output size 1000
8
Copied!
Last modified 2yr ago