- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page