Closed waynieack closed 1 year ago
Update: It's def an issue with how it locks and unlocks for every frame with the edge tpu. I updated /pyzm/ml/coral_edgetpu.py as below in def detect to not release the lock after each frame, so now it just releases when the zm_detect.py script is done and I don't get the error when a second process starts any more.
But this could cause issues where the lock is never released. I believe I am seeing this when I chain the edge tpu and 2 other yolov4 models, I don't see any issue when I chain the edge tpu with 1 yolo model. I need to do more investigation for the locks with more than 2 models to verify if its caused by the change I made or if its happening anyway.
179
180 if self.options.get('auto_lock',True):
181 #self.release_lock()
182 g.logger.Debug(2,'Not Releasing Lock')
183 except:
184 if self.options.get('auto_lock',True):
Moved this to pyzm. https://github.com/ZoneMinder/pyzm/issues/43
Event Server version 6.1.28
Hooks version (if you are using Object Detection) app:6.1.28, pyzm:0.3.56
Are you using MLAPI? N
The version of ZoneMinder you are using: v1.37.25
What is the nature of your issue Bug
Details
Getting Error: HandleQueuedBulkIn transfer in failed. Not found: USB transfer error 5 [LibUsbDataInCallback] when multiple zm_detect.py processes are run at once with the edgetpu.
tpu_max_processes is set to 1.
I am executing the zm_detect.py with a custom script that dynamically generates the list of frames to check for objects after the event is complete which is for the most part all alarmed frames so the list can be up to 30 frames. While the script is going through the frames, it seems to lock and unlock with every frame and when a second process is running it seems to grab the lock from the other process which ends up killing the other process. This really isn't much of an issue with yolov4/GPU because it can handle more than 1 process but it does from time to time it will allow too many to run which causes an out of memory error.
If this happens to many times the TPU is completely locked up and I have to unplug it and plug it back in to get it working again. But I am really not able to use it at this point anyway because it just constantly fails like this.
Debug Logs
Thanks!