Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6364 Discussions

dispatcherEventReceive() Read failed -4 with C API

idata
Employee
643 Views

I hit the error "dispatcherEventReceive() Read failed -4" when programming with C API.

 

But there is no such issue when programming with Python API.

 

I use the same graph, the save test image, the same Ubuntu 16.04 host.

 

Any idea about it?

 

//Error log with C API:

 

Logging level set to: 0

 

D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 0

 

Found device No 0

 

D: [ 0] ncDeviceOpen:501 File path /usr/local/lib/mvnc/MvNCAPI-ma2450.mvcmd

 

I: [ 0] ncDeviceOpen:507 ncDeviceOpen() XLinkBootRemote returned success 0

 

I: [ 0] ncDeviceOpen:536 XLinkConnect done - link Id 0

 

D: [ 0] ncDeviceOpen:550 done

 

I: [ 0] ncDeviceOpen:552 Booted 1.1.1-ma2450 -> VSC

 

I: [ 0] getDevAttributes:373 Device attributes

 

I: [ 0] getDevAttributes:376 Device FW version: 2.4.2450.f0

 

I: [ 0] getDevAttributes:378 mvTensorVersion 2.4

 

I: [ 0] getDevAttributes:379 Maximum graphs: 10

 

I: [ 0] getDevAttributes:380 Maximum fifos: 20

 

I: [ 0] getDevAttributes:382 Maximum graph option class: 1

 

I: [ 0] getDevAttributes:384 Maximum device option class: 1

 

I: [ 0] getDevAttributes:385 Device memory capacity: 522073264

 

Successfully opened device 0

 

Successfully loaded graph file, size is: 31547156

 

I: [ 0] ncGraphAllocate:923 Starting Graph allocation sequence

 

I: [ 0] ncGraphAllocate:988 Sent graph

 

D: [ 0] ncGraphAllocate:1013 Graph Status 0 rc 0

 

D: [ 0] ncGraphAllocate:1059 Input tensor w 416 h 416 c 3 n 1 totalSize 1038336 wstide 6 hstride 2496 cstride 2 layout 0

 

D: [ 0] ncGraphAllocate:1072 output tensor w 13 h 13 c 40 n 1 totalSize 13520 wstide 80 hstride 1040 cstride 2 layout 0

 

I: [ 0] ncGraphAllocate:1126 Graph allocation completed successfully

 

I: [ 0] ncFifoCreate:2126 Init fifo

 

I: [ 0] ncFifoAllocate:2321 Creating fifo

 

I: [ 0] ncFifoCreate:2126 Init fifo

 

I: [ 0] ncFifoAllocate:2321 Creating fifo

 

Successfully allocated graph

 

enqueueImg 1

 

preprocess_image 1

 

preprocess_image 2 416 555, 0.693333

 

preprocess_image 3 69 0 416 416

 

preprocess_image 4 416 416

 

enqueueImg 2

 

enqueueImg 3

 

enqueueImg 3 519168

 

enqueueImg 4 416 416

 

tensor preprocessed

 

D: [ 0] ncFifoWriteElem:2592 No layout conversion is needed 0

 

D: [ 0] convertDataTypeAndLayout:170 src data type 1 dst data type 0

 

D: [ 0] convertDataTypeAndLayout:172 SRC: w 416 h 416 c 3 w_s 12 h_s 4992 c_s 4

 

D: [ 0] convertDataTypeAndLayout:174 DST: w 416 h 416 c 3 w_s 6 h_s 2496 c_s 2

 

D: [ 0] ncFifoWriteElem:2617 write count 0 num_elements 2 userparam (nil)

 

I: [ 0] ncGraphQueueInference:3048 trigger start

 

I: [ 0] ncGraphQueueInference:3145 trigger end

 

tensor loaded

 

E: [ 0] dispatcherEventReceive:200 dispatcherEventReceive() Read failed -4

 

Normal log with python API:

 

D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 0

 

D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 1

 

graph file graph

 

D: [ 0] ncDeviceOpen:501 File path /usr/local/lib/mvnc/MvNCAPI-ma2450.mvcmd

 

I: [ 0] ncDeviceOpen:507 ncDeviceOpen() XLinkBootRemote returned success 0

 

I: [ 0] ncDeviceOpen:536 XLinkConnect done - link Id 0

 

D: [ 0] ncDeviceOpen:550 done

 

I: [ 0] ncDeviceOpen:552 Booted 1.1.1-ma2450 -> VSC

 

I: [ 0] getDevAttributes:373 Device attributes

 

I: [ 0] getDevAttributes:376 Device FW version: 2.4.2450.f0

 

I: [ 0] getDevAttributes:378 mvTensorVersion 2.4

 

I: [ 0] getDevAttributes:379 Maximum graphs: 10

 

I: [ 0] getDevAttributes:380 Maximum fifos: 20

 

I: [ 0] getDevAttributes:382 Maximum graph option class: 1

 

I: [ 0] getDevAttributes:384 Maximum device option class: 1

 

I: [ 0] getDevAttributes:385 Device memory capacity: 522073264

 

I: [ 0] ncGraphAllocate:923 Starting Graph allocation sequence

 

I: [ 0] ncGraphAllocate:988 Sent graph

 

D: [ 0] ncGraphAllocate:1013 Graph Status 0 rc 0

 

D: [ 0] ncGraphAllocate:1059 Input tensor w 416 h 416 c 3 n 1 totalSize 1038336 wstide 6 hstride 2496 cstride 2 layout 0

 

D: [ 0] ncGraphAllocate:1072 output tensor w 13 h 13 c 40 n 1 totalSize 13520 wstide 80 hstride 1040 cstride 2 layout 0

 

I: [ 0] ncGraphAllocate:1126 Graph allocation completed successfully

 

I: [ 0] ncFifoCreate:2126 Init fifo

 

I: [ 0] ncFifoAllocate:2321 Creating fifo

 

I: [ 0] ncFifoCreate:2126 Init fifo

 

I: [ 0] ncFifoAllocate:2321 Creating fifo

 

/usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.

 

warn("The default mode, 'constant', will be changed to 'reflect' in "

 

D: [ 0] ncFifoWriteElem:2592 No layout conversion is needed 0

 

D: [ 0] convertDataTypeAndLayout:170 src data type 1 dst data type 0

 

D: [ 0] convertDataTypeAndLayout:172 SRC: w 416 h 416 c 3 w_s 12 h_s 4992 c_s 4

 

D: [ 0] convertDataTypeAndLayout:174 DST: w 416 h 416 c 3 w_s 6 h_s 2496 c_s 2

 

D: [ 0] ncFifoWriteElem:2617 write count 0 num_elements 2 userparam 0x7ff100f16098

 

I: [ 0] ncGraphQueueInference:3048 trigger start

 

I: [ 0] ncGraphQueueInference:3145 trigger end

 

D: [ 0] ncFifoReadElem:2686 No layout conversion is needed 0

 

D: [ 0] convertDataTypeAndLayout:170 src data type 0 dst data type 1

 

D: [ 0] convertDataTypeAndLayout:172 SRC: w 13 h 13 c 40 w_s 80 h_s 1040 c_s 2

 

D: [ 0] convertDataTypeAndLayout:174 DST: w 13 h 13 c 40 w_s 160 h_s 2080 c_s 4

 

D: [ 0] ncFifoReadElem:2714 num_elements 2 userparam 0x7ff100f16340 output length 27040

 

/usr/lib/python3.5/site-packages/mvnc/mvncapi.py:418: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead

 

tensor = numpy.fromstring(tensor.raw, dtype=numpy.float32)

 

c=40 h=13 w=13 classes=3 imgw=800 imgh=600 thresh=0.200000 nms=0.400000 blockwd=13

 

0.449785 0.508008 0.055721 0.115349

 

0.802951 0.526414 0.073199 0.115363

 

-0.030884 0.522461 0.318359 0.267334 0.313965 0.334717 0.318359 0.317383 0.304443 0.322998 0.288574 0.300781 0.313232 -0.459961 0.810547 0.841309 0.649414 0.603027 0.588867 0.562012 0.558105 0.532227 0.556152 0.573730 0.522461 0.417969 -0.400635 0.487549 0.458984 0.291260 0.230103 0.169922 0.155762 0.187744 0.197510 0.162231 0.131226 0.008354 -0.056793 -0.073853 0.041870 -0.049011 -0.149780 -0.264404 -0.281738 -0.280518 -0.208252 -0.206177 -0.214111 -0.143188 -0.151611 -0.057312 0.820801 -0.487549 -0.297363 0.107422 0.139282 -0.102783 -0.603516 -0.299561 -0.073303 -0.074463 -0.571777 -0.377197 0.224854 2.814453 -1.152344 -0.597168 0.710449 1.921875 1.272461 -0.640625 -0.268311 0.771973 1.841797 -0.597168 -0.852539 0.687500 3.070312 -2.197266 -1.197266 0.683594 2.878906 1.712891 -1.206055 -0.709961 1.184570 3.085938 -0.247803 -1.708008 0.166260 1.620117 -1.049805 -0.338135 0.225098 1.593750 1.181641 -0.159912 -0.105408 0.623047 2

 

total time is " milliseconds 251.5

 

I: [ 0] ncDeviceClose:742 closing device
0 Kudos
2 Replies
idata
Employee
308 Views

Hi @Fei

 

Which Neural Compute SDK version are you using? Could you provide me your model and code to replicate your issue?

 

Regards,

 

Jesus
0 Kudos
idata
Employee
308 Views

Thank you for feedback, Jesus.

 

I finally worked it out.

 

The failure is related to the format of input image.

 

If I remember correctly, CV_32FC3 is the working one.
0 Kudos
Reply