-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
循环对多个视频进行处理时会发生内存泄漏 #148
Comments
是,之前发现过,不过这么干的人也不多(一般用命令行调用可以规避) |
通过内存分析工具,定位在这行代码上:return cv2.cvtColor(old, cv2.COLOR_RGB2GRAY) |
这是一段可以复现bug的代码,将base_dir变量改成本地的一个文件夹,文件夹下有多个视频文件。 |
`from stagesepx.cutter import VideoCutter import os def test(video_path): --- cutter ---cutter = VideoCutter() --- classify ---cl = SVMClassifier() res_dic = classify_result.to_dict() |
短期可以先用命令行调用规避下,opencv的泄露问题挺多的 命令行调用就把循环里调函数改成循环里调脚本 |
好的,谢谢大哥,我暂时用这个方法规避这个问题。 |
load_frames 内存上升 属于预期内的行为,预期是将视频帧一次读入内存供后续分析加速用。 当然欢迎PR,不过也想问问是否有些一定要用这种方式的场景? |
在循环对多个视频进行处理时,内存会异常增长。比如在处理第一个视频时,内存占用为1G。当处理第二个视频时,内存会增长为2G。
The text was updated successfully, but these errors were encountered: