facebookresearch / audiocraft

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.
MIT License
20.18k stars 2.01k forks source link

PermissionError? #339

Open omgitsgb opened 8 months ago

omgitsgb commented 8 months ago

This is the error I get :\ I really am not sure whats going on. any help would be greatly appreciated!

Loading model facebook/musicgen-medium new batch 1 ['lofi hiphop'] [None] Traceback (most recent call last): File "C:\AI\Tools\Music\audiocraft\audiocraft\data\audio.py", line 225, in audio_write _piping_to_ffmpeg(path, wav, sample_rate, flags) File "C:\AI\Tools\Music\audiocraft\audiocraft\data\audio.py", line 156, in _piping_toffmpeg sp.run(command, input=input, check=True) File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 503, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1440, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\routes.py", line 401, in run_predict output = await app.get_blocks().process_api( File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\blocks.py", line 1302, in process_api result = await self.call_function( File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\blocks.py", line 1025, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\AI\Tools\Music\audiocraft\app.py", line 187, in predict_full videos, wavs = _do_predictions( File "C:\AI\Tools\Music\audiocraft\app.py", line 140, in _do_predictions audio_write( File "C:\AI\Tools\Music\audiocraft\audiocraft\data\audio.py", line 229, in audio_write path.unlink() File "C:\Users\NewPr\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1206, in unlink self._accessor.unlink(self) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\NewPr\AppData\Local\Temp\tmpzegdr6iv.wav'

pto199 commented 8 months ago

I'm having the same problem. This software will not work on windows it seems.

sperling commented 8 months ago

I also had this problem. Turns out that you need to have ffmpeg installed. This can be installed with winget on windows 10/11 with the following command

winget install ffmpeg

or use any other install option from https://ffmpeg.org/download.html#build-windows Check that ffmpeg is installed correctly by running ffmpeg from the command line and verify the output to be similar to ffmpeg version 6.0-full_build-www.gyan.dev ... before running python .\demos\musicgen_app.py.

Samyssmile commented 6 months ago

Looks like duplicate of #84