'Troubleshooting Faster RCNN object detection performance on AWS EC2
I am running a Faster RCNN object detection system written in Python on an AWS EC2 instance (T2.large). The input is a video feed from a simple security camera. Usually the object detection system takes about 3 second to process a 512x512 video frame. However, from time to time, the system slows to a crawl, taking 20 sec or more per frame.
I think it may be related to CPU credit per hour limit imposed by AWS. T2.large is allocated 36 CPU credits per hour, equivalent to 36 minutes of 100% CPU utilization per hour.
When I run the command "top -i", it shows the python program is pushing CPU utilization to 200%. If this corresponds to the instance's 2 vCPUs, then it means the python program is using all the CPU resources, then AWS is forced to throttle the performance after about 36 minutes.
While I know training an object detection model would require GPU, I do not believe running a model in inference mode would require high end computing platform as I have seen android based real time object detection system running on cell phones.
Any thoughts on why my python program is using 100% of the CPU capacity? I have added a time.sleep(0.01) statement for all the while loops, and it has no impact on CPU utilization rate.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
