Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
394 Views

Exception: Status.ERROR while running custom model

We are trying a simple classification model originally developed in tensorflow/keras and converted using NCSDK.

 

The conversion was successful creating a graphfile, however during inference we see following error.

 

We did execute other scripts default in ncsappzoo, they tend to work but not this.

 

Are we missing something??

 

 

ERROR

 

Start download to NCS…

 

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

 

E: [ 0] eventReader:254 Failed to receive event, the device may have reset

 

E: [ 0] ncFifoReadElem:2736 Failed to read fifo element

 

Traceback (most recent call last):

 

File "classify.py", line 47, in

 

output, userobj = graph.GetResult()

 

File "../../ncapi2_shim/mvnc_simple_api.py", line 156, in GetResult

 

output, userobj = self._api2_fifo_out.read_elem()

 

File "/usr/local/lib/python3.5/dist-packages/mvnc/mvncapi.py", line 412, in read_elem

 

raise Exception(Status(status))

 

Exception: Status.ERROR

 

 

The script for execution is as follows

 

import sys

 

sys.path.insert(0, "../../ncapi2_shim")

 

import mvnc_simple_api as mvnc

 

import numpy

 

import cv2

 

path_to_networks = './'

 

path_to_images = '.'

 

graph_file_name = './graph_new_2'

 

devices = mvnc.EnumerateDevices()

 

if len(devices) == 0:

 

print('No devices found')

 

quit()

 

print(devices)

 

device = mvnc.Device(devices[0])

 

device.OpenDevice()

 

categories = [0,1]

 

with open(graph_file_name, mode='rb') as f:

 

graph_in_memory = f.read()

 

reqsize = 300

 

graph = device.AllocateGraph(graph_in_memory)

 

img = cv2.imread("img.png").astype(numpy.float32)

 

dx,dy,dz= img.shape

 

img = cv2.resize(img, (reqsize, reqsize))

 

img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)

 

img=img*(1.0/255)

 

print('Start download to NCS…')

 

graph.LoadTensor(img.astype(numpy.float16), 'user object')

 

output, userobj = graph.GetResult()

 

print(output)

 

graph.DeallocateGraph()

 

device.CloseDevice()

 

print('Finished')
0 Kudos
1 Reply
idata
Community Manager
103 Views

I encounter the same problem.

 

The platform is x86_64, Ubuntu 16.04.

 

NCSDK version is 2.08.01.02 .

 

I compile the SSD_MobileNet graph in ncappzoo2.

 

The example I am using is live-object-detector in ncappzoo.

 

I add "import mvnc_simple_api as mvnc" into live-object-detector.py to make it run on NCSDK2.

 

Usually, Status.ERROR comes in an hour.

 

I also see the NCS is disconnected and connected again.

 

I think the NCS is reset like what the error message said.

 

Is there any way to dump the NCS to check what exact problem is?

 

If we can't avoid the the NCS's resetting, how to add error handling in live-object-detector? Re-open the device for a while?
Reply