audiocraft icon indicating copy to clipboard operation
audiocraft copied to clipboard

Error after generation

Open Connum opened this issue 1 year ago • 6 comments

I installed audiocraft locally using Anaconda under Windows 10. The gradio UI starts up fine, but whenever I generate a sound, the progress bar goes to more than 100%: image

Then the UI simply shows "ERROR" in the output area image

and the following errors and traceback are shown in the console:

MP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
Traceback (most recent call last):
  File "D:\Programs\Anaconda3\envs\musicgen\lib\site-packages\gradio\routes.py", line 437, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\Programs\Anaconda3\envs\musicgen\lib\site-packages\gradio\blocks.py", line 1346, in process_api
    result = await self.call_function(
  File "D:\Programs\Anaconda3\envs\musicgen\lib\site-packages\gradio\blocks.py", line 1074, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\Programs\Anaconda3\envs\musicgen\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\Programs\Anaconda3\envs\musicgen\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "D:\Programs\Anaconda3\envs\musicgen\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "E:\AI\audiocraft\app.py", line 138, in predict_full
    outs = _do_predictions(
  File "E:\AI\audiocraft\app.py", line 106, in _do_predictions
    res = [out_file.result() for out_file in out_files]
  File "E:\AI\audiocraft\app.py", line 106, in <listcomp>
    res = [out_file.result() for out_file in out_files]
  File "D:\Programs\Anaconda3\envs\musicgen\lib\concurrent\futures\_base.py", line 458, in result
    return self.__get_result()
  File "D:\Programs\Anaconda3\envs\musicgen\lib\concurrent\futures\_base.py", line 403, in __get_result
    raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

I can find the generated wav file in the temp folder, so the generation itself seems to run through as intened, and it must be something happening after that that's causing the issue. Any subsequent tries to generate something will result in the same error over again or a CUDA out of memory error. I have to restart the app and am then able to generate a single sound file like above.

Any idea what's causing that and how it can be fixed?

I have a quite old GTX980Ti with 6GB VRAM, but as I said the sound generation itself is working, so that shouldn't be the issue.

Connum avatar Jun 14 '23 10:06 Connum

Same thing happening, but its a new issue.

ethank avatar Jun 14 '23 14:06 ethank

I got same issue too.

FelixMaHK1 avatar Jun 15 '23 09:06 FelixMaHK1

Setting the environment variable KMP_DUPLICATE_LIB_OK=TRUE as proposed does indeed resolve the symptom and audio generation then works as intended, but the underlying issue should be fixed code-wise nevertheless.

Connum avatar Jun 15 '23 10:06 Connum

Out GPU memory(((

BuBaLoM-JMP avatar Jun 15 '23 12:06 BuBaLoM-JMP

Setting the environment variable KMP_DUPLICATE_LIB_OK=TRUE as proposed does indeed resolve the symptom and audio generation then works as intended, but the underlying issue should be fixed code-wise nevertheless.

Where is this variable? Appreciate

venturaEffect avatar Sep 17 '23 10:09 venturaEffect

Setting the environment variable KMP_DUPLICATE_LIB_OK=TRUE as proposed does indeed resolve the symptom and audio generation then works as intended, but the underlying issue should be fixed code-wise nevertheless.

Where is this variable? Appreciate

For those who didn't know the answer, add to app.py after import os line: os.environ['KMP_DUPLICATE_LIB_OK']='True'

koolara avatar May 16 '24 00:05 koolara