I am trying to run two graphs in two different process with single movidius stick using python multiprocessing. I have tried different approaches to solve this, but not able to achieve the goal.
I want to know whether it is possible to do so or not. If possible, then please give some hint to do it.
Great work @PINTO , I looked at your code. You are opening and using the device in the same process but want I am trying is bit different.
Since I have one movidius stick and two graphs, I am opening the device and assign the graphs in the main process and trying to use the fifoIn and fifoOut of one graph in one process and for another graph in another process. Is it possible to do?
You can not share one stick with two processes.
You can use two sticks in one process.
Because, when sharing objects between processes, the target object must be able to convert to pickle type.
Unfortunately we can not convert graph objects to pickle.
Thanks @PINTO , This is really helpful for me.
I want to clear one more thing from you whether those two graph can be run at a same time in a single processes. For example, if I give the image to both the fifoIn, will be execute at same time. May be if both the graphs are compiled with 12 shaves then it is not, but if the graphs are compiled with 6 shaves per graph then any chance, will it run?
It depends on the size of the model, so I do not know until I try it.
btw, my environment.
graph size = 11.6 MB
12 shave x 2 graph x 1 stick(NCS, not NCS2) -> OK
12 shave x 3 graph x 1 stick(NCS, not NCS2) -> NG
The reason for becoming NG is a bug in NCSDKv2.
Thanks @PINTO ,
I have experimented all.
3 graphs can't be loaded a time.
Two graphs can run at a time if the sum of the number of shaves of individual graphs is less than or equal to the maximum (12).