TMElyralab / MuseTalk

MuseTalk: Real-Time High Quality Lip Synchorization with Latent Space Inpainting
Other
2.84k stars 354 forks source link

PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'temp.mp4' #208

Open ZRSN-1101 opened 1 month ago

ZRSN-1101 commented 1 month ago

Moviepy - Done ! Moviepy - video ready ./results/output\outputxxx_sun_sun.mp4 Traceback (most recent call last): File "D:\MTalk\MuseTalk.glut\lib\site-packages\gradio\queueing.py", line 536, in process_events response = await route_utils.call_process_api( File "D:\MTalk\MuseTalk.glut\lib\site-packages\gradio\route_utils.py", line 321, in call_process_api output = await app.get_blocks().process_api( File "D:\MTalk\MuseTalk.glut\lib\site-packages\gradio\blocks.py", line 1935, in process_api result = await self.call_function( File "D:\MTalk\MuseTalk.glut\lib\site-packages\gradio\blocks.py", line 1520, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore File "D:\MTalk\MuseTalk.glut\lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( File "D:\MTalk\MuseTalk.glut\lib\site-packages\anyio_backends_asyncio.py", line 2144, in run_sync_in_worker_thread return await future File "D:\MTalk\MuseTalk.glut\lib\site-packages\anyio_backends_asyncio.py", line 851, in run result = context.run(func, args) File "D:\MTalk\MuseTalk.glut\lib\site-packages\gradio\utils.py", line 826, in wrapper response = f(args, kwargs) File "D:\MTalk\MuseTalk.glut\lib\site-packages\gradio\utils.py", line 826, in wrapper response = f(*args, *kwargs) File "D:\MTalk\MuseTalk.glut\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(args, kwargs) File "D:\MTalk\MuseTalk\app.py", line 310, in inference os.remove("temp.mp4") PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'temp.mp4'

FredCircle commented 5 days ago

文件资源没有被释放,需要在app.py中的os.remove("temp.mp4")之前加上一句reader.close()