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

Error when allocating another Graph

I'm running Movidius in a loop with several Graphs.

 

The first graph runs normally and after that it's deallocated.

 

When the second loop starts running and when the code tries to allocate

 

the second graph, an error occurs. I've tried to close and reopen the

 

device, but didn't work anyway.

 

Traceback (most recent call last):

 

File "/home/joaoreiser/Documentos/UFSC/Dissertação/Arquivos_Testes_Python/Time_2/Inference.py", line 33, in

 

graph = device.AllocateGraph(graphfile)

 

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

 

raise Exception(Status(status))

 

Exception: mvncStatus.ERROR

 

Traceback (most recent call last):

 

File "/home/joaoreiser/Documentos/UFSC/Dissertação/Arquivos_Testes_Python/Time_2/Inference.py", line 32, in

 

device.OpenDevice()

 

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

 

raise Exception(Status(status))

 

Exception: mvncStatus.ERROR

 

Is there anyway of change the graph during the code execution?

 

The piece of code where the Movidius is used:

 

with open(fl, mode='rb') as f: graphfile = f.read() device = mvnc.Device(devices[0]) device.OpenDevice() graph = device.AllocateGraph(graphfile) print('Download to NCS') for i in range(20): graph.LoadTensor(data.astype(np.float16), 'inf') output, userobj = graph.GetResult() graph.DeallocateGraph() device.CloseDevice()

 

Thanks!

0 Kudos
1 Reply
idata
Community Manager
76 Views

Hi @joaoreiser

 

First, is it possible to have the full code (the two loops)

 

Second, after the first loop, do you only deallocate the graph or also close the device?

 

Indeed, the Traceback point to the OpenDevice function which means that maybe it is already open…

 

There is no need to recreate a device and so on.

 

Basically I already created a loop doing like so:

 

create_device open_device start_loop: allocate graph load_tensor get_result deallocate_graph allocate_graph_2 load_tensor get_result_2 deallocate_graph

 

So it should work in your case too.

 

Hope it helped

 

Regards

Reply